468,257 Members | 1,460 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,257 developers. It's quick & easy.

Border Problems

I am doing something so simple but I can't seem to get the right
results.

I want the border of my <td> to start after 39px, just like the text.

..td
{
padding-left: 39px;
padding-top: 5px;
border-top: 1px solid #cc9900
}

The text is padded but the border stretches across the whole cell. If
I use margin-left instead, the text doesn't indent 39px. Can someone
help???
Jul 20 '05 #1
2 2129
/John/:
I am doing something so simple but I can't seem to get the right
results.

I want the border of my <td> to start after 39px, just like the text.

.td
{
padding-left: 39px;
padding-top: 5px;
border-top: 1px solid #cc9900
}

The text is padded but the border stretches across the whole cell. If
I use margin-left instead, the text doesn't indent 39px. Can someone
help???


Table cells don't have margins, consult with
<http://www.w3.org/TR/CSS21/tables.html>. Just use a container
element inside the table cell:

<td>
<div class="hopa">Your text</div>
</td>

div.hopa {
margin-left: 39px;
padding-top: 5px;
border-top: 1px solid #cc9900
}

--
Stanimir
Jul 20 '05 #2
Thank you very much! That was driving me insane!!!
Stanimir Stamenkov <s7****@netscape.net> wrote in message news:<c5*************@ID-207379.news.uni-berlin.de>...
/John/:
I am doing something so simple but I can't seem to get the right
results.

I want the border of my <td> to start after 39px, just like the text.

.td
{
padding-left: 39px;
padding-top: 5px;
border-top: 1px solid #cc9900
}

The text is padded but the border stretches across the whole cell. If
I use margin-left instead, the text doesn't indent 39px. Can someone
help???


Table cells don't have margins, consult with
<http://www.w3.org/TR/CSS21/tables.html>. Just use a container
element inside the table cell:

<td>
<div class="hopa">Your text</div>
</td>

div.hopa {
margin-left: 39px;
padding-top: 5px;
border-top: 1px solid #cc9900
}

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

33 posts views Thread by Thomas Mlynarczyk | last post: by
7 posts views Thread by Mary Ellen Curtin | last post: by
4 posts views Thread by David Ehmer | last post: by
12 posts views Thread by Cameron McCormack | last post: by
1 post views Thread by Keith Smith | last post: by
2 posts views Thread by Asterbing | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.