Skip to content

Instantly share code, notes, and snippets.

@GaryJones
Last active December 23, 2015 02:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save GaryJones/ab0b07e1c8561b1d53ba to your computer and use it in GitHub Desktop.
Corrections for Theme Unit Test data - Tables
<!-- Current (2013-09-05) Theme Unit Test Data, as found in Post Markup, Page Markup, and Comment tests -->
<table>
<tbody>
<tr>
<th>Employee</th>
<th class="views">Salary</th>
<th></th>
</tr>
<tr class="odd">
<td><a href="http://example.org/">John Doe</a></td>
<td>$1</td>
<td>Because that's all Steve Job' needed for a salary.</td>
</tr>
<tr class="even">
<td><a href="http://example.org/">Jane Doe</a></td>
<td>$100K</td>
<td>For all the blogging he does.</td>
</tr>
<tr class="odd">
<td><a href="http://example.org/">Fred Bloggs</a></td>
<td>$100M</td>
<td>Pictures are worth a thousand words, right? So Tom x 1,000.</td>
</tr>
<tr class="even">
<td><a href="http://example.org/">Jane Bloggs</a></td>
<td>$100B</td>
<td>With hair like that?! Enough said...</td>
</tr>
</tbody>
</table>
<!-- More correct semantic markup -->
<table>
<thead>
<tr>
<th>Employee</th>
<th>Salary</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<th><a href="http://example.org/">John Doe</a></th>
<td>$1</td>
<td>Because that's all Steve Jobs needed for a salary.</td>
</tr>
<tr>
<th><a href="http://example.org/">Jane Doe</a></th>
<td>$100K</td>
<td>For all the blogging she does.</td>
</tr>
<tr>
<th><a href="http://example.org/">Fred Bloggs</a></th>
<td>$100M</td>
<td>Pictures are worth a thousand words, right? So Jane x 1,000.</td>
</tr>
<tr>
<th><a href="http://example.org/">Jane Bloggs</a></th>
<td>$100B</td>
<td>With hair like that?! Enough said...</td>
</tr>
</tbody>
</table>
<!--
Line 37, 43: thead element added in to markup the table head row. Standard semantic markup.
Line 40: Removed oddly named class of "views" - isn't an expected class, and doesn't seem
to match anything.
Line 45, 50, 55, 60: Removed odd and even classes. While these are WordPress-generated classes
for individual comments, I don't think it's realistic to expect styles to also cater
for alternate table rows as well, so including them in the unit test is redundant.
Line 46, 51, 56, 61: First cell in each row changed to th, since the data in the first column
is a heading for the rest of the row. Standard semantic markup, allowing a differentiation
between thead > tr > th and tbody > tr > th.
Also:
Line 48: Job' => Jobs
Line 53: he => she
Line 58: Tom => Jane
-->
@rohitink
Copy link

I had noticed issue this quite a few times, while coding the CSS part for my themes. Good Work (Y).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment