Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How do you set margin in a TD?

Reply
Thread Tools

How do you set margin in a TD?

 
 
Jibba Jabba
Guest
Posts: n/a
 
      02-13-2004
Been trying the whole night but just can't set a left margin for a TD using
CSS. Can someone help me with this? I've searched google and tried
margin-left, margin, etc. and not are doing it. Help!


 
Reply With Quote
 
 
 
 
GD
Guest
Posts: n/a
 
      02-13-2004
Jibba Jabba <(E-Mail Removed)> wrote:
> Been trying the whole night but just can't set a left margin for a TD
> using CSS.


Margins only apply to the outer table, not cells. Padding only applies
to cells, not the outer table.

Cellspacing (what you're after) is done in CSS using the border-spacing
property, however MSIE doesn't support it (as usual):


table {
margin:1em 5%;
border:black thick solid;
border-spacing:2em 0.25em;
}

th,td {
padding:0.25em;
border:black thin solid;
}

As an aside, another property for the outer table is border-collapse.
This collapses the borders throughout the whole table and is supported
from IE6 (though maybe IE5.5 supports it too?). You would use this
property *instead* of border spacing:

table {
margin:1em 5%;
border:black thin solid;
border-collapse:collapse;
}

 
Reply With Quote
 
 
 
 
Leif K-Brooks
Guest
Posts: n/a
 
      02-13-2004
Jibba Jabba wrote:
> Been trying the whole night but just can't set a left margin for a TD using
> CSS. Can someone help me with this? I've searched google and tried
> margin-left, margin, etc. and not are doing it. Help!


Table cells don't have margin. A wild guess says you want padding.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why can't I set a tr margin? rosdi HTML 9 06-10-2011 01:08 PM
How to have margin-left: 10%; margin-right: 10%; only sometimes?? Cal Who ASP .Net 4 05-17-2010 12:17 PM
How to have margin-left: 10%; margin-right: 10%;" only sometimes Cal Who ASP .Net 1 05-16-2010 08:53 PM
Can I set a margin inside table cell? f HTML 5 07-16-2006 02:44 AM
Epson 4000 - margin to margin? nobody Digital Photography 6 03-28-2005 05:17 PM



Advertisments