Forum Moderators: not2easy

Message Too Old, No Replies

Stylizing a Table Row

         

Argblat

4:52 pm on Sep 8, 2005 (gmt 0)

10+ Year Member



Is it possible using css to create the border-bottom effect for an entire row as opposed to having to give each td within the row the property and collapse the table?

An example would be the first row of a table which contains the headers for each column. I want to be able to put a thick black line between this header and the start of the data...can I do this using the TR and not the TD?

thanks
Mike

tedster

6:37 pm on Sep 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about using <tr class="under"> in the html, and then, in the css file:

tr.under td { border-bottom:1px solid #fff; }

MatthewHSE

10:47 pm on Sep 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Unfortunately, you cannot actually place a border on a table row. I believe you can specify backgrounds, however, so if you made a background image the height of the border you want, then set it to tile horizontally and set the position to bottom left, that should work.

jetboy

12:06 am on Sep 9, 2005 (gmt 0)

10+ Year Member



Might be worth swatting up on the W3C table spec:

[w3.org ]

Using <th> instead of <td> in the header row would allow you to style the first row without needing to add any classes. Taking advantage of <thead> and tedster's descendant selector would be an alternative.

I'd still follow MatthewHSE's route and use images though.

The best tip I can give is to Google for 'Tables For Tabular Data' and Stephen Ferg's 'Techniques for Accessible HTML Tables'. I guarantee that you'll learn loads of things that'll make styling tables a doddle.

Argblat

1:52 pm on Sep 9, 2005 (gmt 0)

10+ Year Member



Thank you all for the help. I'm always happy to recieve more information than less, and now I've got plenty to read and think about as I tinker.

-Mike