I have a table and I want to style at tr level. This does not work on IE7 if I apply the style directly to the tr.
What’s the best way to go about styling the table so I get a line across all rows but have no line at the very top or at the very bottom.
So basically, the table should look something like this
col1 col2 col3
--------------
col1 col2 col3
--------------
col1 col2 col3
--------------
col1 col2 col3
You can do this without the
:last-childselector, in a way that is also compatible with IE7. And of course without JavaScript:Actually you are using the top border to draw a line, taking advantage of the fact that the
tr + trselector will match all rows except the first one.See it in action.