Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Borders 1

Status
Not open for further replies.

fatstu

Technical User
Feb 22, 2002
20
US
How do I put a small 1 pixel black line along my table borders. I have used the following code but it only fills the outside edges with the line.

<table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; bordercolor=&quot;#000000&quot; bgcolor=&quot;#EEEEFF&quot; STYLE=&quot;border:solid black 1px&quot;>

I need the line to show each row and column border. Any help would be appreciated
 
Set border=&quot;1&quot; and you will get a one pixel border around every cell. The STYLE definition for the border only applies to the outside border.

Mitch Duszynski
Web Developer
Human Kinetics
PO Box 5076, Champaign, IL 61825
Tel: 217-351-5076 x2474 | Fax: 217-351-2674
mitchd@hkusa.com |
 
That gives me to thick a line, like the table at the bottom of the page (the one that contains &quot;email this thread, top of page, next thread etc). What I need is the same thickness of line created by my previously posted code. Any ideas?
 
you could give a style to each cell

<style>
TD { border:1px solid black }
</style>

this style will be applied to all TDs on the page, alternatively give it a classname ie

TD.blackBorder { border:1px solid black }

and then the cells that you want the border on should be given a class=blackBorder ie

<TD class=blackBorder> ...</td>
 
But if you style the cell then it doubles the line thickness when it touches another cell. Surely it can be done, Ive seen it done in so many forums, bulletin boards etc. e.g. You can see the table they use has the thin line.
 
Thank you thank you thank you...it works!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top