padding inside table

Discussion in 'HTML' started by Paul Furman, Feb 12, 2004.

  1. Paul Furman

    Paul Furman Guest

    How come this doesn't work for me? I tried all sorts of combinations and
    the text inside the td's is smashed pretty tight to the edges by a
    couple pixels or so. IE & Mozilla see nothing. Mozilla doesn't see the
    background color but that's another issue. I want a little space between
    the border and the text, that's padding, right?

    Wrapping the contents in a div inside the td works
    <div style="padding: 4px;">

    this doesn't:
    table.normal {
    font-size: 8pt;
    font-family: Arial;
    background-color=#CCD8CD;
    border=1px solid #aaaaaa;
    border-collapse: collapse;
    padding-left: 4px;
    }
    td.normal {
    border=1px solid #aaaaaa;
    padding: 4px;
    }

    <table class="normal" width="480px">
    <tr>
    <td align="left" class="normal">
    text here
    Paul Furman, Feb 12, 2004
    #1
    1. Advertising

  2. Paul Furman wrote:

    > table.normal {
    > font-size: 8pt;
    > font-family: Arial;
    > background-color=#CCD8CD;
    > border=1px solid #aaaaaa;
    > border-collapse: collapse;
    > padding-left: 4px;
    > }
    > td.normal {
    > border=1px solid #aaaaaa;
    > padding: 4px;
    > }


    Get rid of the equals signs (=) and use colons :)) instead.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Feb 12, 2004
    #2
    1. Advertising

  3. Paul Furman

    GD Guest

    Paul Furman <> wrote:
    > How come this doesn't work for me?
    > table.normal {
    > background-color=#CCD8CD;
    > border=1px solid #aaaaaa;
    > padding-left: 4px;
    > }
    > td.normal {
    > border=1px solid #aaaaaa;
    > }


    Padding is for the cells, not the table itself, but the main problem
    here is the typos. You've used equals signs in 3 of the properties.

    The CSS validator would have spotted these ;)
    http://jigsaw.w3.org/css-validator/
    GD, Feb 12, 2004
    #3
  4. Paul Furman

    Paul Furman Guest

    GD wrote:
    >
    > Padding is for the cells, not the table itself,



    OK so it only applies to <td>.


    > but the main problem here is the typos.
    > You've used equals signs in 3 of the properties.



    Thanks I fixed that. And I've finally dumped it into a separate css file
    so I won't have to run in circles to update leftover junk like that again.

    The padding still doesn't work though.
    Paul Furman, Feb 12, 2004
    #4
  5. Paul Furman

    GD Guest

    Paul Furman <> wrote:
    > GD wrote:
    > > Padding is for the cells, not the table itself,


    > OK so it only applies to <td>.


    And <th> :)

    > The padding still doesn't work though.


    Do you have an example URL? If you fixed the typo above the padding
    property, I can't see anything else to stop it working.
    GD, Feb 12, 2004
    #5
  6. Paul Furman

    Paul Furman Guest

    GD wrote:
    > Paul Furman <> wrote:
    >
    >>The padding still doesn't work though.

    >
    >
    > Do you have an example URL? If you fixed the typo above the padding
    > property, I can't see anything else to stop it working.


    OK, I uploaded this version with the div patch commented out:

    http://hills.ccsf.edu/~pfurma02/index.php?SCREEN=ecards.php
    http://hills.ccsf.edu/~pfurma02/paul.css

    and the relevant code:

    <table class="normal" width="480px">
    <tr>
    <td align="left" class="normal">
    <!-- <div style="padding: 4px;"> -->

    Echivaria Topsy-turvey.<br>
    <hr width=100%>
    A selection of my favorite pictures taken in many locations
    and sorted in no particular order. <!-- </div> -->
    </td>
    </tr>
    </table>
    Paul Furman, Feb 12, 2004
    #6
  7. Paul Furman

    Paul Furman Guest

    Paul Furman wrote:

    > GD wrote:
    >
    >> Paul Furman <> wrote:
    >>
    >>> The padding still doesn't work though.

    >>
    >>
    >>
    >> Do you have an example URL? If you fixed the typo above the padding
    >> property, I can't see anything else to stop it working.

    >
    >
    > OK, I uploaded this version with the div patch commented out:
    >
    > http://hills.ccsf.edu/~pfurma02/index.php?SCREEN=ecards.php
    > http://hills.ccsf.edu/~pfurma02/paul.css



    Oddly, it's maybe 2 pixels on the unix server at school and nearly
    touching the border on my win2k apache server at home.

    BTW, I've changed 'normal' to 'textbox'

    Damn, now that overwrote whatever it was & they are both bad.


    This is what was up a few minutes ago:

    table.normal {
    font-family: Arial;
    background-color: #CCD8CD;
    border: 1px solid #aaaaaa;
    border-collapse: collapse;
    }
    td.normal {
    border: 1px solid #aaaaaa;
    padding: 4px;
    }



    >
    > and the relevant code:
    >
    > <table class="normal" width="480px">
    > <tr>
    > <td align="left" class="normal">
    > <!-- <div style="padding: 4px;"> -->
    >
    > Echivaria Topsy-turvey.<br>
    > <hr width=100%>
    > A selection of my favorite pictures taken in many locations
    > and sorted in no particular order. <!-- </div> -->
    > </td>
    > </tr>
    > </table>
    >
    Paul Furman, Feb 12, 2004
    #7
  8. Paul Furman

    Paul Furman Guest

    Paul Furman wrote:
    >
    > BTW, I've changed 'normal' to 'textbox'
    >
    > Damn, now that overwrote whatever it was & they are both bad.


    OK that was it, I had the names mixed up. Too many times back & forth.

    Sorry.
    Paul Furman, Feb 12, 2004
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RA
    Replies:
    1
    Views:
    370
  2. Alain Hogue

    Changing the inside Padding of a WebPart

    Alain Hogue, Jan 15, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    494
    Alain Hogue
    Jan 15, 2006
  3. Serial # 19781010
    Replies:
    1
    Views:
    505
    William Tasso
    Aug 10, 2003
  4. =?ISO-8859-1?Q?=BBQ=AB?=

    padding inside an input (text) tag

    =?ISO-8859-1?Q?=BBQ=AB?=, Jan 11, 2006, in forum: HTML
    Replies:
    8
    Views:
    1,653
    Toby Inkster
    Jan 12, 2006
  5. Eustace

    table td padding

    Eustace, Oct 1, 2009, in forum: HTML
    Replies:
    34
    Views:
    1,929
    Neredbojias
    Oct 7, 2009
Loading...

Share This Page