[html5] empty cells

webmaster webmaster at tsmchughs.com
Sun Mar 20 15:00:27 PDT 2011


I'm seeing what I think is a bug in Safari with regard to empty cells in 
a table. I have a restaurant dinner menu marked up as a table:

http://www.tenmercer.com/menu/dinner

The first <tr> of each <tbody> element contains only a <th> element 
(thanks to hixie for the scope="rowgroup" suggestion a couple of weeks 
ago). Each subsequent <tr> has 3 cells: a <th> and two <td>s. My style 
sheet has a rule to place a border-bottom on tbody tr:first-child. In 
Firefox, the border extends across the table, but not in Safari.

"Calculating the number of columns in a table" from the html 4 spec
http://www.w3.org/TR/html401/struct/tables.html#h-11.2.4.3
says "user agents should base the number of columns on what is required 
by the rows" when there is no <col> or <colgroup> elements.

I actually tried inserting both <col> and <colgroup> elements, with no 
change. But if I explicitly add empty <td> elements, as in this menu

http://www.tenmercer.com/menu/glutenfree

then the border extends, even in Safari.

I tried to find something in the html5 spec, but I'm having trouble 
deciphering

http://dev.w3.org/html5/spec/Overview.html#table-model

Is there something more recent regarding how browsers should calculate 
the number of cells in a table?

-- 
Brian T



More information about the Help mailing list