Forum Moderators: open

Message Too Old, No Replies

How to add line around cell/table (frame/borders?)

         

jackdack

10:55 pm on Aug 25, 2005 (gmt 0)

10+ Year Member



I want to add a line between cells in a table. Also, on other tables add lines to certain sides of a cell or table i.e. any one or all of the four sides to a cell.

I gather you can do this using the html border frame tag, but I haven't seen this used and I wonder if there are other better ways of doing it? any thoughts? does the border frame tag work OK? thanks

MichaelBluejay

11:38 pm on Aug 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I don't think you can do it with HTML, but you can do it with CSS.

To add a box around just one cell:

<TD style="border:1px solid gray">

To add a top and bottom border to a cell:

<TD> style="border-top:1px solid gray; border-bottom:1px solid gray">

To add a line after every row, in the HEAD

<style type="text/css">.myline TR {border-bottom:1px solid gray}</style>

Then in your table:

<TR class=myline>

I'm not 100% sure you can add borders to TR's with CSS, but it's worth a try.

jackdack

12:06 am on Aug 26, 2005 (gmt 0)

10+ Year Member



OK, so CSS must be the option which a lot of people use...
I'll give it a try. Thank you