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!

Vertical lines for HTML tables

Status
Not open for further replies.

seek4need

Technical User
Aug 12, 2008
14
US
Hi,

How can I draw a vertical lines for the table. I don't want the dotted lines and horizontal lines.

Please guide me how to code this. weather I need to use HTML or CSS.

Thanks,
Srinivas

 
Depending on where you want the lines, you can have a CSS class for your cells that specifies just the side lines for each cell.

for example putting the following between your header tags <head></head> will give all the cells a vertical border on the left.:

Code:
<style type="text/css">

table { 
border:0px; 
}
td{ 
border-left:1px solid red;
}
</style>

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I tried the above css code but I am getting dotted vertical lines. If I want straigt vertical lines for the tables? what change I need to do.

Products
|Product1|product11
|product2|product12
|product3|product13
.
.
.
.



 
You need give the table no cellspacing and no cellpadding.


Code:
<table cellspacing='0' cellpadding='0'>

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks it worked well....!

I used the below command and your CSS code both got the same result....

<table frame=vsides cellspacing='0' cellpadding='0'>

cellspacing, cellpadding worked well.

I am looking for line around the table border. Please let me know how it is possible.

I would like to avoid the line on each and every cell.

Thanks

 
Instead of specifying it for the cell do it for the table:

Code:
table{
border:1px solid red;
}

td{
border:0px;
}

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top