By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,767 Members | 1,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,767 IT Pros & Developers. It's quick & easy.

Border Problems

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
/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

P: n/a
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.