hiding table cell border

Discussion in 'HTML' started by richard, Jul 12, 2008.

  1. richard

    richard Guest

    I am attempting to create a table layout and I want to NOT have the
    borders show in a particular group of cells in that column.

    If I use border-bottom-style:none/hidden I still wind up with a border
    showing.

    Assuming I have 6 rows, 6 columns.
    Row 1, col 2 will have a bottom border.
    Row 2, col2, no border.
    Row 3, col 2 no border.
    Row 4, col 2 no border.
    Row 5, col 2 no border.
    Row 6, col 2 border.

    All other cells have full borders.

    In divisions, I could easily do this but my data is better suited for
    tables. As you know, there are basically TWO borders per cell in a
    table.

    So how do you go about NOT showing both borders?
     
    richard, Jul 12, 2008
    #1
    1. Advertising

  2. richard

    richard Guest

    On Sat, 12 Jul 2008 10:00:39 -0400, richard <>
    wrote:

    >I am attempting to create a table layout and I want to NOT have the
    >borders show in a particular group of cells in that column.
    >
    >If I use border-bottom-style:none/hidden I still wind up with a border
    >showing.
    >
    >Assuming I have 6 rows, 6 columns.
    >Row 1, col 2 will have a bottom border.
    >Row 2, col2, no border.
    >Row 3, col 2 no border.
    >Row 4, col 2 no border.
    >Row 5, col 2 no border.
    >Row 6, col 2 border.
    >
    >All other cells have full borders.
    >
    >In divisions, I could easily do this but my data is better suited for
    >tables. As you know, there are basically TWO borders per cell in a
    >table.
    >
    >So how do you go about NOT showing both borders?


    I did find one way of using two classes hiding the top and bottom
    borders as needed but there should be a simpler way.
     
    richard, Jul 12, 2008
    #2
    1. Advertising

  3. Scripsit richard:

    > I am attempting to create a table layout and I want to NOT have the
    > borders show in a particular group of cells in that column.


    URL?

    > If I use border-bottom-style:none/hidden I still wind up with a border
    > showing.


    URL?

    > Assuming I have 6 rows, 6 columns.
    > Row 1, col 2 will have a bottom border.
    > Row 2, col2, no border.
    > Row 3, col 2 no border.
    > Row 4, col 2 no border.
    > Row 5, col 2 no border.
    > Row 6, col 2 border.
    >
    > All other cells have full borders.


    URL? A URL would let us see, among other things, exactly what you have
    tried and how the "Row 6, col 2 border." line is to be read - did you
    omit "no", or do you mean it should have all borders? Assuming the
    latter (since the former would be easier, just leave out the last rule
    below), this would do the job:

    td { border: solid red 1px; } /* or something like that */
    tr:first-child td:first-child + td { border-style: none none solid
    none; }
    td:first-child + td { border-style: none; }
    tr:first-child + tr + tr + tr + tr + tr td:first-child + td
    { border-style: solid; }

    As usual, IE does not support this except from version 7 onwards in
    "standards" mode. If you wish to produce the effect on older versions of
    6, use classes.

    (This is a bit tricky. My first attempt used just border: none in the
    3rd rule. It is instructive to work out why that would be wrong. Hint:
    shortcuts cut your shorts!)

    > As you know, there are basically TWO borders per cell in a
    > table.


    Huh? There are FOUR borders (up, right, bottom, left).

    > So how do you go about NOT showing both borders?


    We need to understand what you mean by TWO borders.

    Maybe you mean that you have border-collapse: collapse. That would be a
    different story entirely, but it does not mean that a cell has two
    borders. It just means that borders "collapse" in particular way. A URL
    would have revealed whether this was your _real_ probem.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jul 12, 2008
    #3
  4. richard

    richard Guest

    On Sun, 13 Jul 2008 17:14:47 +0100, Martin Jay
    <> wrote:

    >On Sat, 12 Jul 2008 10:00:39 -0400, richard <>
    >wrote:
    >
    >>I am attempting to create a table layout and I want to NOT have the
    >>borders show in a particular group of cells in that column.
    >>
    >>If I use border-bottom-style:none/hidden I still wind up with a border
    >>showing.
    >>
    >>Assuming I have 6 rows, 6 columns.
    >>Row 1, col 2 will have a bottom border.
    >>Row 2, col2, no border.
    >>Row 3, col 2 no border.
    >>Row 4, col 2 no border.
    >>Row 5, col 2 no border.
    >>Row 6, col 2 border.
    >>
    >>All other cells have full borders.

    >
    >Something like this?
    >
    ><http://www.spam-free.org.uk/examples/table_borders.html>


    Close. Thanks. Tried out a few combinations and then decided to change
    the format altogether.
     
    richard, Jul 14, 2008
    #4
    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. tshad
    Replies:
    0
    Views:
    2,277
    tshad
    Jan 31, 2005
  2. phl
    Replies:
    1
    Views:
    4,376
    Martin Jay
    Jun 8, 2006
  3. Coder
    Replies:
    1
    Views:
    712
    Cowboy \(Gregory A. Beamer\)
    Jun 24, 2006
  4. =?UTF-8?B?TWFydGluIFDDtnBwaW5n?=

    border-color: #003366; border-width: 2px;

    =?UTF-8?B?TWFydGluIFDDtnBwaW5n?=, Jul 17, 2006, in forum: HTML
    Replies:
    64
    Views:
    3,563
    Adrienne Boswell
    Jul 30, 2006
  5. Doug

    No table border for blank cell

    Doug, Sep 3, 2005, in forum: ASP General
    Replies:
    3
    Views:
    234
Loading...

Share This Page