Opened 8 months ago

Last modified 3 months ago

#22086 new enhancement

HTML5 and cellspacing="0" in admin pages

Reported by: MattyRob Owned by:
Priority: normal Milestone: Awaiting Review
Component: Administration Version: 3.4
Severity: minor Keywords: has-patch needs-testing 2nd-opinion
Cc: info@…

Description

There are several instances where generated table content uses 'cellspacing="0"' in the admin areas of WordPress.

The W3C validator (albeit experimental) states that this parameter should be dropped and CSS used instead for HTML5 compliance.

I think the patch I'm going to attach in a moment will fix these validation issues.

Attachments (5)

22086.patch (7.9 KB) - added by MattyRob 8 months ago.
22086v2.patch (7.8 KB) - added by MattyRob 8 months ago.
22086v3.patch (6.9 KB) - added by MattyRob 8 months ago.
22086v4.patch (6.9 KB) - added by MattyRob 8 months ago.
22086v5.diff (7.6 KB) - added by MattyRob 3 months ago.

Download all attachments as: .zip

Change History (14)

  • Cc info@… added

padding:0px 0px 0px 0px; should be padding: 0;. Same for other values.

@toscho - quite right - can't believe I missed that!

  • Keywords ui-feedback removed

Actually, padding is not equivalent to cellspacing. You want border-collapse and border-spacing. If you look carefully, I think you'd find that removing padding like that results in lots of unwanted side effects. Additionally, you'll want to be sure to only apply the rules to table elements with those selectors, as things like .widefat can be used for all kinds of elements. Also, structural CSS should not go in color files but rather the wp-admin.css sheet.

@helenyhou,

I had border-collapse and border-spacing in the patch as well as the padding. I'll take your superior knowledge and remove the padding elements and move the CSS to the wp-admin.css file and submit a revised patch later.

The wp-admin.css file contains this:

/* .widefat - main style for tables */

So, does the styling for this need to be applied only to the HTML tag? Is the class being mis-used or is this documentation incorrect?

comment:5 follow-up: ↓ 6   MattyRob8 months ago

Updated patch with CSS moved into wp-admin.css. I just need to check how the CSS is minified. What service is used for this?

comment:6 in reply to: ↑ 5   SergeyBiryukov8 months ago

Replying to MattyRob:

I just need to check how the CSS is minified. What service is used for this?

There's no need to patch minified files, a post-commit bot takes care of it.

@SergeyBiryukov - thanks, didn't know that.

v4 patch seems to work better - appearance goes off a little with the first patch - top and bottom of tablets gets cropped.

  • Version changed from trunk to 3.4

Updated against revision 23455

Note: See TracTickets for help on using tickets.