border-top not working in col

Discussion in 'HTML' started by Phil, Nov 11, 2008.

  1. Phil

    Phil Guest

    How come the <col> style doesn't render the same in both cases:


    <HTML><BODY>
    <TABLE style="border: thin solid black">
    <COL style="border-bottom:thin solid">
    <TBODY>
    <TR>
    <TD>row 1 col 1 items</TD>
    <TD>row 1 col 2 items</TD></TR>
    <TR>
    <TD>row 2 col 1 items</TD>
    <TD>row 2 col 2 items</TD></TR>
    <TR>
    <TD>row 3 col 1 items</TD>
    <TD>row 3 col 2 items</TD></TR>
    </TBODY></TABLE></BODY></HTML>



    <TABLE style="border-collapse:collapse;border: thin solid black">
    <TBODY>
    <TR>
    <TD style="border-bottom:thin solid">
    row 1 col 1 items</TD>
    <TD>row 1 col 2 items</TD></TR>
    <TR>
    <TD style="border-bottom:thin solid">row 2 col 1 items</TD>
    <TD>row 2 col 2 items</TD></TR>
    <TR>
    <TD style="border-bottom:thin solid">row 3 col 1 items</TD>
    <TD>row 3 col 2 items</TD></TR>
    </TBODY></TABLE></BODY></HTML>
     
    Phil, Nov 11, 2008
    #1
    1. Advertisements

  2. Phil

    richard Guest


    probably because no color was given to it.

    In the <table> tag, the border refers only to the outside perimiter,
    not the border of each cell.
     
    richard, Nov 11, 2008
    #2
    1. Advertisements

  3. Phil

    Bergamot Guest

    Only certain properties can be styled on the col element. Border is not
    one of them.
     
    Bergamot, Nov 11, 2008
    #3
  4. URL? Browser? You don't even reveal whether your snippet is used in Quirks
    mode or "Standards" mode.

    And what do expect to happen when you set a border on an element that
    denotes a column? In any case, _I_ wouldn't expect much, since columns are
    really strangers in CSS-land.
     
    Jukka K. Korpela, Nov 11, 2008
    #4
  5. Phil

    Phil Guest

    Thanks, I could only suspect so because I didn't see in the docs that it
    wasn't applicable.

    I just figured the col attributes would be applied to all TD elements in
    the column.
     
    Phil, Nov 12, 2008
    #5
  6. Phil

    Bergamot Guest

    For inheritance like that to happen, td would have to be a child of col.
    It's not - it's a child of tr. Besides, border is not an inherited property.
     
    Bergamot, Nov 12, 2008
    #6
  7. Phil

    GTalbot Guest

    Please post an URL, not code.

    "The various border properties apply to columns only if 'border-
    collapse' is set to 'collapse' on the table element."
    http://www.w3.org/TR/CSS21/tables.html#columns

    Regards, GĂ©rard
     
    GTalbot, Nov 25, 2008
    #7
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.