Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A <code>&lt;table&gt;</code> can have multiple <code>&lt;tbody&gt;</code> children, which represent row groups. I've not used the <code>&lt;colgroup&gt;</code> element before, so I'll leave that for someone else to add, but here is a solution that will allow you to achieve your styling needs whilst keeping it semantic:</p> <pre><code>&lt;table&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th scope="col"&gt;col 1&lt;/th&gt; &lt;th scope="col"&gt;col 2&lt;/th&gt; &lt;th scope="col"&gt;col 3&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;row 1&lt;/td&gt; &lt;td&gt;row 1&lt;/td&gt; &lt;td&gt;row 1&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;row 2&lt;/td&gt; &lt;td&gt;row 2&lt;/td&gt; &lt;td&gt;row 2&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;row 3&lt;/td&gt; &lt;td&gt;row 3&lt;/td&gt; &lt;td&gt;row 3&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th scope="col"&gt;col 4&lt;/th&gt; &lt;th scope="col"&gt;col 5&lt;/th&gt; &lt;th scope="col"&gt;col 6&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;row 4&lt;/td&gt; &lt;td&gt;row 4&lt;/td&gt; &lt;td&gt;row 4&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;row 5&lt;/td&gt; &lt;td&gt;row 5&lt;/td&gt; &lt;td&gt;row 5&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;row 6&lt;/td&gt; &lt;td&gt;row 6&lt;/td&gt; &lt;td&gt;row 6&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th scope="col"&gt;col 7&lt;/th&gt; &lt;th scope="col"&gt;col 8&lt;/th&gt; &lt;th scope="col"&gt;col 9&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;row 7&lt;/td&gt; &lt;td&gt;row 7&lt;/td&gt; &lt;td&gt;row 7&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;row 8&lt;/td&gt; &lt;td&gt;row 8&lt;/td&gt; &lt;td&gt;row 8&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;row 9&lt;/td&gt; &lt;td&gt;row 9&lt;/td&gt; &lt;td&gt;row 9&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>I based this on information from the <a href="http://dev.w3.org/html5/spec/Overview.html#tabular-data" rel="nofollow noreferrer">HTML 5 spec</a>, but it should be valid HTML 4 as well.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload