I\'m trying to design some HTML/CSS that can put a border around specific rows in a table. Yes, I know I\'m not really supposed to use tables for layout but I don\'t know en
I was just playing around with doing this too, and this seemed to be the best option for me:
Note that this will prevent the use of fluid/automatic column widths, as cells will no longer align with those in other rows, but border/colour formatting still works OK. The solution is to give the TR and TDs a specified width (either px or %).
Of course you could make the selector tr.myClass if you wanted to apply it only to certain rows. Apparently display: table doesn't work for IE 6/7, however, but there's probably other hacks (hasLayout?) that might work for those. :-(