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

Status
Not open for further replies.

z35

Programmer
Dec 21, 2001
206
US
Hi,

I gave my table a border. Is it possible to give all the cells a border and remove the border that is around the entire table.

All the components have borders but the big border around the whole thing shouldn't be seen.
 
Is this what you're after...

In the Head section

<style>
table
{
border: 0px;
}

td
{
border: 2px solid red;
}
</style>
 
yes..but is it possible to do this without style sheets, in html??
 
it dosen't seem to work without it. is there some reason why you do not wish to use css?
 
I prefer doing things in a simpler way if possible...in case of browsers that do not support css.

in this case...i'll use css.

however...I have more than one table in my page and I want this to apply to only one table.

can i make this into a class and apply it to the table i want??


 
nested table is the answer to achieving this. The outher table background color works as the border

eg
<table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; bgcolor=&quot;0000CC&quot; width=&quot;400&quot;>
<tr>
<td colspan=&quot;2&quot; width=&quot;100%&quot;>

<!-- EMBEDDED TABLE BEGINS HERE >

<table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; bgcolor=&quot;0000CC&quot; height=&quot;15&quot; width=&quot;100%&quot;>
<tr>
<td width=&quot;33%&quot; height=&quot;100%&quot; bgcolor=&quot;#9400d3&quot;>

</td>
<td width=&quot;34%&quot; height=&quot;100%&quot;>

</td>
<td width=&quot;33%&quot; height=&quot;100%&quot; bgcolor=&quot;#9400d3&quot;>

</td>
</tr>
</table>

<!-- END EMBEDDED TABLE -->

</td>
</tr>
<tr>
<td width=&quot;50%&quot; bgcolor=&quot;#cc0000&quot; height=&quot;25&quot;>

</td>
<td width=&quot;50%&quot; bgcolor=&quot;#00cc00&quot; height-&quot;25&quot;>

</td>
</tr>
</table>

Ranjan
fragments of dream, weave them together
 
try this for css on one tably only:

<table style=&quot;border:0px;&quot;>
<tr>
<td style=&quot;border: 2px solid red;&quot;>text</td>
<td style=&quot;border: 2px solid red;&quot;>text</td>
</tr>
</table>

the sested table idea is definetly not the simplest one. but the css one will not work in NS4.x. i vote for css, it downgrades to no border at all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top