The HTML spec allows for multiple tbody
elements in tables. I have a case like that where Firefox doesn't seem to want to handle collapsed borders.
The borders on the second table display properly in Chrome 37, but don't do so hot in Firefox 33 or Internet Explorer 11.
Basically, it looks like if there is any tbody
that contains (only?) hidden content, then it fails to render the borders correctly for the whole table.
Is there a workaround to get the borders to draw correctly?
I've tried not collapsing the borders, which seems to work, but leaves this particular table looking different than other tables on the site.
Code sample for fiddle linked above:
With multiple `tbody` elements:
<table class="mainContent">
<thead><tr><th>hi</th><th>there</th></tr></thead>
<tbody><tr><td>hi</td><td>there</td></tr></tbody>
<tbody><tr><td>hi</td><td>there</td></tr></tbody>
<tbody><tr><td>hi</td><td>there</td></tr></tbody>
<tbody><tr><td>hi</td><td>there</td></tr></tbody>
<tbody><tr><td>hi</td><td>there</td></tr></tbody>
</table>
<br />
<br />
If any of the tbody
elements contain a single display: none
row then things go awry:
<table class="mainContent">
<thead><tr><th>hi</th><th>there</th></tr></thead>
<tbody><tr><td>hi</td><td>there</td></tr></tbody>
<tbody><tr class="hide"><td>hi</td><td>there</td></tr></tbody>
<tbody><tr><td>hi</td><td>there</td></tr></tbody>
<tbody><tr><td>hi</td><td>there</td></tr></tbody>
<tbody><tr><td>hi</td><td>there</td></tr></tbody>
</table>
And the styles:
table {
border-collapse: collapse;
}
table tr td {
border: solid 1px #ccc;
padding: 4px;
}
.hide {
display: none;
}