hiding table cell border

R

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.

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?
 
R

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.

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.
 
J

Jukka K. Korpela

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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top