Opened 12 years ago
Last modified 8 years ago
#10021 confirmed Bug
Table plugin uses attributes deprecated in HTML5 — at Version 13
Reported by: | Danil | Owned by: | |
---|---|---|---|
Priority: | Nice to have (we want to work on it) | Milestone: | |
Component: | Core : Tables | Version: | |
Keywords: | Cc: |
Description (last modified by )
When I insert new table, without any settings i get border="1" cellpadding="1" cellspacing="1" style="width: 500px;" attributes. These are unexpected and non-valid ones.
Edit:
When I insert new table it uses attributes that are deprecated in HTML5
cellpadding,cellspacing,align,summary,rules,frame,bgcolor attributes. Please see: http://www.w3schools.com/tags/tag_table.asp
Easy workaround (aka solution): comment:13.
Change History (12)
comment:2 Changed 12 years ago by
comment:3 Changed 12 years ago by
Description: | modified (diff) |
---|---|
Summary: | Insert table plugin adds unexpected attributes → Table plugin uses attributes deprecated in HTML5 |
comment:4 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:5 Changed 12 years ago by
Component: | Core : Editable → Core : Tables |
---|---|
Description: | modified (diff) |
Status: | new → confirmed |
@danya_postfactum I have modified your description as you are right - CKEditor uses some old and deprecated attributes that should be replaced by styles in HTML5.
- When creating table one can always delete these values in table dialog (manually set values to zero or delete them)
- These default values are set in dialog plugin and the only way to change them is by setting them to empty values:
CKEDITOR.on( 'dialogDefinition', function( ev ) { var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; if ( dialogName == 'table' ){ var infoTab = dialogDefinition.getContents( 'info' ); infoTab.get( 'txtBorder' ).default = ''; infoTab.get( 'txtWidth' ).default = ''; infoTab.get( 'txtCellSpace' ).default = ''; infoTab.get( 'txtCellPad' ).default = ''; } } );
comment:6 Changed 12 years ago by
Thanks, this is more correct info. But I still think default width should be null.
comment:7 Changed 12 years ago by
Description: | modified (diff) |
---|
- These are not used by editor: rules,frame,bgcolor
- This can probably be dropped: summary
- This can perhaps be replaced by float in style attribute: - align
- There is a problem with: cellpadding and cellspacing
We still support IE7 and Quirks mode which makes this request very nice but impossible to implement at the given moment at least for these two attributes
Links:
http://www.quackit.com/css/css_cellpadding.cfm
http://www.quackit.com/css/css_cellspacing.cfm
http://stackoverflow.com/questions/339923/how-to-set-cellpadding-and-cellspacing-in-css
http://www.w3schools.com/cssref/pr_tab_border-spacing.asp
comment:8 Changed 12 years ago by
Please, be very careful before forcing this change for everybody.
Something similar was decided to change the dimensions in images and it has been an ongoing source of frustration for too many people.
And just testing a little shows that not setting a default width for a table makes it quite hard for the users to edit it easily (vs having a default with).
comment:9 Changed 12 years ago by
@alfonsoml - good point. The ticket you have mentioned is #5547 and yes lots of users have complained that e.g. outlook doesn't accept width and height in styles but only as attributes.
You are 100% right, before implementing this some heavy research should be made. Idea looks interesting and modern but editor should also coexist with other apps or tools.
comment:10 Changed 12 years ago by
@danya_postfactum nowadays you can use ACF and decide whether you want to use attributes or styles. Please see:
http://ckeditor.com/blog/Upgrading-to-CKEditor-4.1
http://ckeditor.com/blog/CKEditor-4.1-RC-Released
http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter
http://docs.ckeditor.com/#!/api/CKEDITOR.filter-method-addTransformations
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-allowedContent
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraAllowedContent
comment:13 Changed 11 years ago by
Description: | modified (diff) |
---|
BTW. Since CKEditor 4.4 this is possible:
CKEDITOR.replace( 'editor1', { disallowedContent: 'table[cellspacing,cellpadding,border]' } );
Fields are removed from the dialog and content is filtered on input. This works even in ACFs automatic mode, so no need to redefine entire allowed content rules.
Read more in the Disallowed Content guide.
How can I get rid of these deprecated attributes? I use stylesheet file to style plain tables (I guess most modern sites use it). Is any settings to tweak table plugin? It should at least use css to have any effect.