Can I set a margin inside table cell?

F

f

Hi,

How can I set a margin inside a table cell?

The cellSpacing and cellPadding didn't do the job I want it to be.
I only want the content of the cell to shift to the right by x margin...

Thanks,
Kian
 
S

Steve Pugh

f said:
How can I set a margin inside a table cell?

Table cells don't have margins, they do have padding though.
The cellSpacing and cellPadding didn't do the job I want it to be.

And they're deprecated to boot,
I only want the content of the cell to shift to the right by x margin...

So you want some left padding?

Hmm, how about the following in your style sheet-
td {padding-left: 1em;}

Add a class if you only want a few cells to be affected.
Alter the property value to suit your needs.

Steve
 
K

Kian

Thanks.

It is working now when I use:
<div style="padding-left: 3em"> </div> inside my table cell.

Thank you very much.
 
S

Steve Pugh

David Dorward said:
When? They weren't by XHTML 1.0 (although IMO they _should_ be)

You're quite right they're not. I must have had a memory failure and
just done a presentational = deprecated.

Steve
 
Joined
Jul 16, 2006
Messages
1
Reaction score
0
I know there is a way to use stylesheet to set that up. I have same question. I tried using all kinds of commands. It would be great if there is like a global command that would do that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top