setting the margin in one cell

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

I have one cell (<td>) that I want to have a margin in to move everything
away from the left border by about 10 px.

The only way I can seem to do it is to add cellspacing in each of the
elements in the Cell (2 tables and button). I wanted to set it in just one
place. "<td style=margin-left:10>" doesn't do anything.

Is there a way to do this?

Thanks,

Tom.
 
Tom,
There's an easier way. You need margins, but can't get them on a
cell since a cell doesn't have a margin property. You can't set the
cellspacing or padding because it does it to every cell. So, the next best
thing is to find a way that you're only dealing with one cell and don't have
to worry about the rest. Put a one celled table within that cell then you
can set the padding of that table to what you need and place your content in
that table, or have two cells, one that has a width of 10 (with a spacer
image in it to hold the width at 10), and the other uses the rest.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
Mark Fitzpatrick said:
Tom,
There's an easier way. You need margins, but can't get them on a
cell since a cell doesn't have a margin property. You can't set the
cellspacing or padding because it does it to every cell. So, the next best
thing is to find a way that you're only dealing with one cell and don't
have to worry about the rest. Put a one celled table within that cell then
you can set the padding of that table to what you need and place your
content in that table, or have two cells, one that has a width of 10 (with
a spacer image in it to hold the width at 10), and the other uses the
rest.

But I already have lots of tables in the page. Is that going to be "table
overload" for just one cell?

Also, how do I set up a space image? Is that just a transparent image?

Thanks,

Tom.
 
td's do not have a margin, thats handled by the cellspacing. you want to set
the padding

<td style="padding-left:10">

-- bruce (sqlwork.com)


| I have one cell (<td>) that I want to have a margin in to move everything
| away from the left border by about 10 px.
|
| The only way I can seem to do it is to add cellspacing in each of the
| elements in the Cell (2 tables and button). I wanted to set it in just
one
| place. "<td style=margin-left:10>" doesn't do anything.
|
| Is there a way to do this?
|
| Thanks,
|
| Tom.
|
|
 
bruce barker said:
td's do not have a margin, thats handled by the cellspacing. you want to
set
the padding

<td style="padding-left:10">

That was what I was looking for.

I assume cellpadding and padding is the same (except that padding you can
give it a direction). One you use "style=" and the other you just put into
the tag.

Thanks,

Tom
 
Back
Top