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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing table cell borders in CSS 1

Status
Not open for further replies.

LaPluma

Programmer
Feb 3, 2002
139
DE
Hello

I have a poll.asp site here:


If you visit the page and vote, you will be taken to a page which displays the voting results. These results are displayed in table form, but each cell has a border which I would like to remove.

I thought that could be done using the following CSS:

<style type=&quot;text/css&quot;>
TD { border: 1px solid black; }
</style>

but I can't seem to get it to work.

On the other hand, it may be that I have the code positioned wrongly.

Basically, I have an .asp file and have simply pasted the style statement (above) into the top of the .asp file like this:

<html>
<head>
<style type=&quot;text/css&quot;>
TD { border: 1px solid black; }
</style>
</head>

Then, at the end, I have the closing html tag. In between, I have html code (tables, borders, etc) and VB script for the poll itself.

I would be grateful for any comments or advice.

LaPluma
 
a few things about that page.
your missing a opening <body> tag and a closing </body>
tag. bad form not to have them, exspecialy when you have a head section declared

align the cells with the chart in them to the left and give them a set width. will look better trust me.

the last table needs a space between the table and border
it's like this now
<tableborder=&quot;1&quot;
needs to be
<table border=&quot;1&quot;



I'm confused on what you are asking for
this line
TD { border: 1px solid black; }
says to give every TD a solid 1px border. if you want only certain cells to have borders then do this
<style>
.CellStyle { border: 1px solid black; }
</style>
then in the table for the ones you want to have this border setting do this
<td class=&quot;CellStyle&quot;>

If you want what you are asking but each cell has a border which I would like to remove
take the code out of the head

hope that helps A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
Hello Onpnt

Many thanks for your reply.

You ointed me on the right road, and eventually I messed about with:

<style>
.borderOn { border : 1px solid black ; }
.borderOff { border : none ; }
</style>

I did correct the space:

<tableborder=&quot;1&quot;
needs to be
<table border=&quot;1&quot;

and inserted the body tags.

I think you will agree that it looks better now:


Best wishes and tanks very much - again.

LaPluma
 
Hi LaPluma,
It looks 100% better. glad I helped out.

[thumbsup2] A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top