cellspacing question

Discussion in 'HTML' started by Tony Vella, Nov 17, 2003.

  1. Tony Vella

    Tony Vella Guest

    I would like to leave 12px between cells in a table. If I enter
    cellspacing="12" into each <table> (tedious) it works perfectly every time,
    but when I try to enter cellspacing into my css there are two things:
    one: I'm using TopStyle Lite 3.1 and against the "table" selector the
    cellspacing option is not available, and
    two: If I enter it by hand (cellspacing: 12px;) it does not work.

    So, can anyone tell me how to enter cellspacing in a ccs, please? Thanks in
    advance.

    --
    Tony Vella in Ottawa, Canada
     
    Tony Vella, Nov 17, 2003
    #1
    1. Advertising

  2. Tony Vella

    rf Guest

    "Tony Vella" <> wrote in message
    news:tmVtb.14601$...
    > I would like to leave 12px between cells in a table. If I enter
    > cellspacing="12" into each <table> (tedious) it works perfectly every

    time,
    > but when I try to enter cellspacing into my css there are two things:
    > one: I'm using TopStyle Lite 3.1 and against the "table" selector the
    > cellspacing option is not available, and
    > two: If I enter it by hand (cellspacing: 12px;) it does not work.
    >
    > So, can anyone tell me how to enter cellspacing in a ccs, please? Thanks

    in
    > advance.


    table {border-spacing: 12px}

    Doesn't work in IE though.

    Cheers
    Richard.
     
    rf, Nov 17, 2003
    #2
    1. Advertising

  3. Tony Vella

    Tony Vella Guest

    rf wrote:
    > "Tony Vella" <> wrote in message
    > news:tmVtb.14601$...
    >> I would like to leave 12px between cells in a table. If I enter
    >> cellspacing="12" into each <table> (tedious) it works perfectly
    >> every time, but when I try to enter cellspacing into my css there
    >> are two things: one: I'm using TopStyle Lite 3.1 and against the
    >> "table" selector the cellspacing option is not available, and
    >> two: If I enter it by hand (cellspacing: 12px;) it does not work.
    >>
    >> So, can anyone tell me how to enter cellspacing in a ccs, please?
    >> Thanks in advance.

    >
    > table {border-spacing: 12px}
    >
    > Doesn't work in IE though.
    >
    > Cheers
    > Richard.


    Oh, well, entering cellspacing in every <table> is tedious but at least it
    works. Thanks Richard.

    --
    Tony Vella in Ottawa, Canada
     
    Tony Vella, Nov 17, 2003
    #3
  4. Tony Vella

    Marc Nadeau Guest

    Le Lundi, 17 Nov 2003 01:19:21 +0000, Tony Vella a écrit :

    > I would like to leave 12px between cells in a table. If I enter
    > cellspacing="12" into each <table> (tedious) it works perfectly every time,
    > but when I try to enter cellspacing into my css there are two things:
    > one: I'm using TopStyle Lite 3.1 and against the "table" selector the
    > cellspacing option is not available, and
    > two: If I enter it by hand (cellspacing: 12px;) it does not work.
    >
    > So, can anyone tell me how to enter cellspacing in a ccs, please? Thanks in
    > advance.


    Use

    td {
    margin: 12px;
    }

    in your style sheet.

    Find a better tool for style tasks. eg: any simple text editor.

    Bonne chance
     
    Marc Nadeau, Nov 17, 2003
    #4
  5. Tony Vella

    Tony Vella Guest

    Marc Nadeau wrote:
    > Le Lundi, 17 Nov 2003 01:19:21 +0000, Tony Vella a écrit :
    >
    >> I would like to leave 12px between cells in a table. If I enter
    >> cellspacing="12" into each <table> (tedious) it works perfectly
    >> every time, but when I try to enter cellspacing into my css there
    >> are two things:
    >> one: I'm using TopStyle Lite 3.1 and against the "table" selector
    >> the cellspacing option is not available, and
    >> two: If I enter it by hand (cellspacing: 12px;) it does not work.
    >>
    >> So, can anyone tell me how to enter cellspacing in a ccs, please?
    >> Thanks in advance.

    >
    > Use
    >
    > td {
    > margin: 12px;
    > }
    >
    > in your style sheet.
    >
    > Find a better tool for style tasks. eg: any simple text editor.
    >
    > Bonne chance


    Je te remercie, mon ami!

    --
    Tony Vella in Ottawa, Canada
     
    Tony Vella, Nov 17, 2003
    #5
  6. "Marc Nadeau" <> wrote:

    > td {
    > margin: 12px;
    > }


    If it "works", the browser is in error, since by CSS specifications, margin
    properties do not affect elements that are presented as table cells. This
    is, rather nastily, not mentioned in the description of the margin property
    and only en passant in the description of visual presentation of tables:

    "Like other elements of the document language, internal table elements
    generate rectangular boxes with content, padding, and borders. They do not
    have margins, however."
    http://www.w3.org/TR/REC-CSS2/tables.html#q7

    The CSS 2.1 draft tries to clarify things here, see
    http://www.w3.org/TR/CSS21/box.html#propdef-margin

    The border-spacing property that rf mentioned is the correct CSS way, and
    the practical way at present is to use the HTML attribute.

    However, why would you use a spacing of 12 pixels? Sounds rather big, and
    why use physical units? In fact, it sounds that you are not presenting
    tabular data but doing some layout only. In that case, a completely
    different CSS approach might be in order, even if you continue using tables
    for layout. (Maybe spacing can do what you want. URL?)

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, Nov 17, 2003
    #6
  7. Tony Vella wrote:

    > I would like to leave 12px between cells in a table. If I enter
    > cellspacing="12" into each <table> (tedious) it works perfectly every
    > time, but when I try to enter cellspacing into my css there are two
    > things:


    > one: I'm using TopStyle Lite 3.1 and against the "table" selector the
    > cellspacing option is not available, and
    > two: If I enter it by hand (cellspacing: 12px;) it does not work.


    This is becuase there is no "cellspacing" property in CSS.

    > So, can anyone tell me how to enter cellspacing in a ccs, please?


    <http://www.w3.org/TR/CSS2/tables.html#propdef-border-spacing>

    --
    David Dorward http://dorward.me.uk/
     
    David Dorward, Nov 17, 2003
    #7
  8. Tony Vella

    Tony Vella Guest

    Jukka K. Korpela wrote:
    > "Marc Nadeau" <> wrote:
    >
    >> td {
    >> margin: 12px;
    >> }

    >
    > If it "works", the browser is in error, since by CSS specifications,
    > margin properties do not affect elements that are presented as table
    > cells. This is, rather nastily, not mentioned in the description of
    > the margin property and only en passant in the description of visual
    > presentation of tables:
    >
    > "Like other elements of the document language, internal table elements
    > generate rectangular boxes with content, padding, and borders. They
    > do not have margins, however."
    > http://www.w3.org/TR/REC-CSS2/tables.html#q7
    >
    > The CSS 2.1 draft tries to clarify things here, see
    > http://www.w3.org/TR/CSS21/box.html#propdef-margin
    >
    > The border-spacing property that rf mentioned is the correct CSS way,
    > and the practical way at present is to use the HTML attribute.
    >
    > However, why would you use a spacing of 12 pixels? Sounds rather big,
    > and why use physical units? In fact, it sounds that you are not
    > presenting tabular data but doing some layout only. In that case, a
    > completely different CSS approach might be in order, even if you
    > continue using tables for layout. (Maybe spacing can do what you
    > want. URL?)


    I am preparing a virtual album of the Sudan Camel Postman stamps of
    1898-1998. I have to enter information under each stamp, such as catalogue
    number, type of watermark, date of issue, date of surcharge, etc. When the
    stamps are wide I have no problem but when the stamps are small (narrow)
    dates like January 25, 1922 and March 21, 1922 end up touching each other.
    So, since I only want 4 stamps maximum in each row, I can afford to
    experiment with cellspacing until there is a decent gap between the longest
    texts under each stamps. I am looking for a way of avoiding having to enter
    the cellspacing manually in each <table>. The bottom line, I guess, is that
    I do not wish to spend so much time writing HTML or learning some new
    write-up language that I no longer have time for stamp collecting.

    <table border="0" cellspacing="12" summary="">
    <tr>
    <td><img src="29.jpg" border="0" width="87" height="103"
    alt=""><br>29<br>February 4, 1922</td>
    <td><img src="30.jpg" border="0" width="87" height="103"
    alt=""><br>30<br>1922</td>
    <td><img src="31.jpg" border="0" width="87" height="103"
    alt=""><br>31<br>January 25, 1922</td>
    <td><img src="32.jpg" border="0" width="87" height="103"
    alt=""><br>32<br>March 21, 1922</td>
    </tr>
    </table>

    In my Mexican "Exporta" virtual album at
    http://members.rogers.com/tony.vella/mexico/index.html I will not have to
    face the same problem when I enter the dates of issue because all exportas
    are rather wide stamps. Thanks to all for all help.

    --
    Tony Vella in Ottawa, Canada
     
    Tony Vella, Nov 18, 2003
    #8
  9. Tony Vella

    rf Guest

    "Tony Vella" <> wrote in message
    news:fwdub.23875$...

    > I am preparing a virtual album of the Sudan Camel Postman stamps of
    > 1898-1998. I have to enter information under each stamp, such as

    catalogue
    > number, type of watermark, date of issue, date of surcharge, etc. When

    the
    > stamps are wide I have no problem but when the stamps are small (narrow)
    > dates like January 25, 1922 and March 21, 1922 end up touching each other.
    > So, since I only want 4 stamps maximum in each row, I can afford to
    > experiment with cellspacing until there is a decent gap between the

    longest
    > texts under each stamps. I am looking for a way of avoiding having to

    enter
    > the cellspacing manually in each <table>. The bottom line, I guess, is

    that
    > I do not wish to spend so much time writing HTML or learning some new
    > write-up language that I no longer have time for stamp collecting.


    Hmmm. Matters change when the real problem is stated, not, as Jukka often
    says: difficulties with a perceived solution.

    td {padding: 12px}

    which *does* work with IE.

    Cheers
    Richard.
     
    rf, Nov 18, 2003
    #9
  10. Tony Vella

    Tony Vella Guest

    rf wrote:
    > "Tony Vella" <> wrote in message
    > news:fwdub.23875$...
    >
    >> I am preparing a virtual album of the Sudan Camel Postman stamps of
    >> 1898-1998. I have to enter information under each stamp, such as
    >> catalogue number, type of watermark, date of issue, date of
    >> surcharge, etc. When the stamps are wide I have no problem but when
    >> the stamps are small (narrow) dates like January 25, 1922 and March
    >> 21, 1922 end up touching each other. So, since I only want 4 stamps
    >> maximum in each row, I can afford to experiment with cellspacing
    >> until there is a decent gap between the longest texts under each
    >> stamps. I am looking for a way of avoiding having to enter the
    >> cellspacing manually in each <table>. The bottom line, I guess, is
    >> that I do not wish to spend so much time writing HTML or learning
    >> some new write-up language that I no longer have time for stamp
    >> collecting.

    >
    > Hmmm. Matters change when the real problem is stated, not, as Jukka
    > often says: difficulties with a perceived solution.
    >
    > td {padding: 12px}
    >
    > which *does* work with IE.
    >
    > Cheers
    > Richard.


    I've tried it. It does exactly what I want it to do. Thanks again.

    --
    Tony Vella in Ottawa, Canada
     
    Tony Vella, Nov 18, 2003
    #10
    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. Malderez Cédric

    Array & cellspacing

    Malderez Cédric, Sep 16, 2003, in forum: HTML
    Replies:
    1
    Views:
    811
    David Dorward
    Sep 16, 2003
  2. shank

    convert cellspacing to CSS

    shank, Jan 23, 2004, in forum: HTML
    Replies:
    8
    Views:
    22,376
    shank
    Jan 24, 2004
  3. Guest

    cellspacing = 0 ?

    Guest, Apr 9, 2004, in forum: HTML
    Replies:
    3
    Views:
    585
    Guest
    Apr 9, 2004
  4. Gnarlodious
    Replies:
    2
    Views:
    7,403
    Gnarlodious
    Apr 10, 2004
  5. Todd Cary
    Replies:
    12
    Views:
    10,510
    kchayka
    Sep 18, 2004
Loading...

Share This Page