Border Problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    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???
  • Stanimir Stamenkov

    #2
    Re: Border Problems

    /John/:
    [color=blue]
    > 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???[/color]

    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">Yo ur text</div>
    </td>

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

    --
    Stanimir

    Comment

    • John

      #3
      Re: Border Problems

      Thank you very much! That was driving me insane!!!


      Stanimir Stamenkov <s7an10@netscap e.net> wrote in message news:<c51ma1$2l isnv$1@ID-207379.news.uni-berlin.de>...[color=blue]
      > /John/:
      >[color=green]
      > > 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???[/color]
      >
      > 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">Yo ur text</div>
      > </td>
      >
      > div.hopa {
      > margin-left: 39px;
      > padding-top: 5px;
      > border-top: 1px solid #cc9900
      > }[/color]

      Comment

      Working...