I have a variable number of table rows (n), and I would like the border bottom to apply to rows 0..(n-1)
how do I do that?
I have a variable number of table rows (n), and I would like the border bottom to apply to rows 0..(n-1)
how do I do that?
If you can apply classes to your markup, add a specialized class to the final row n.
markup:
<table>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr class="last">
<td>
</td>
</tr>
</table>
CSS:
table
{
border-collapse:collapse;
}
td
{
border-bottom: 1px solid #000;
}
.last td
{
border-bottom: none;
}
Your other option is to use the :last-child CSS selector but IE doesn't support it.