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

Increase space between HTML table columns

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
GB
Hi,

I want to increase the space between HTML table columns so as to separate the data nicely for the user to view. I do not want to increase the space between table rows though. I've tried using cellspacing but it doesn't seem to distinguish between column and row spacing.

Your help would be much appreciated

Clive [infinity]
 
<style>
TD {
border:0px solid white;
border-bottom:2px solid white;
border-top:2 solid white;
background-color:#EEEEEE;
}
</style>


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

----------
I'm willing to trade custom scripts for... [see profile]
 
Oops, misread but still the same idea..

<style>
TD {
border-right:2px solid white;
border-left:2px solid white;
border-bottom:0px solid white;
border-top:0 solid white;
background-color:#EEEEEE;
}
</style>


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

----------
I'm willing to trade custom scripts for... [see profile]
 
Solve the problem with CSS:
Code:
<style type=&quot;text/css&quot;>
 td {
  padding: 0px 5px 0px 5px;
 }
</style>
This way you're entering spacific padding to every side of the cell. The values start with padding-top and continue clock-wise. Meaning this will result in cell padding 0 on the top and bottom and 5px left and right. Hope it helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top