I'm trying to add borders around specific table rows which change it's colors when the mouse enters the row. However, I don't see a border at all unless using border-collapse:collapse;
but I have to avoid border-collapse, since in some cases the border is visible left, right and at bottom but not on top (probably because I cannot have padding/margin when using border-collapse).
Is there a way to achieve this?
<table style="border-collapse:collapse;">
<tr style="border:1px solid black">
<td>Cell_1</td>
<td>Cell_2</td>
</tr>
</table>
You can try using outline
instead.
tr:hover {
outline: 1px solid #999;
}
Have a look: http://jsfiddle.net/dWWkx/3/
As far as I know you can't put a border on a table row, but you can on the table cell (<td>
).
With some creative border-right and border-left, with a cell-spacing of 0, you should be able to achieve the appearance of a border around the whole row.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With