J
Jan Aagaard
I have a simple table
+---+---+
| A | B |
+---+---+
| C | D |
+---+---+
And would like to have space between the cells, but not on the border
of the table.
If I add cellspacing or cellpadding to the table I get something like
this:
+-+---+-+---+-+
+-+---+-+---+-+
| | A | | B | |
+-+---+-+---+-+
+-+---+-+---+-+
| | C | | D | |
+-+---+-+---+-+
+-+---+-+---+-+
But what I would really like is this:
+---+-+---+
| A | | B |
+---+-+---+
+---+-+---+
| C | | D |
+---+-+---+
Is it possible to achieve that by only applying styles to the
<table>-element and not the individual <td>-elements? Perhaps using
<tbody> and <colgroup>?
I know it would be possible by adding right padding to A and C and
bottom padding to A and B, but I would like a general rule for the
table.
Another solution would be to add empty cells and use them as spacers,
but that adds a lot of extra cells if my table is larger than 2 x 2.
(Sorry about the ASCII graphics.)
+---+---+
| A | B |
+---+---+
| C | D |
+---+---+
And would like to have space between the cells, but not on the border
of the table.
If I add cellspacing or cellpadding to the table I get something like
this:
+-+---+-+---+-+
+-+---+-+---+-+
| | A | | B | |
+-+---+-+---+-+
+-+---+-+---+-+
| | C | | D | |
+-+---+-+---+-+
+-+---+-+---+-+
But what I would really like is this:
+---+-+---+
| A | | B |
+---+-+---+
+---+-+---+
| C | | D |
+---+-+---+
Is it possible to achieve that by only applying styles to the
<table>-element and not the individual <td>-elements? Perhaps using
<tbody> and <colgroup>?
I know it would be possible by adding right padding to A and C and
bottom padding to A and B, but I would like a general rule for the
table.
Another solution would be to add empty cells and use them as spacers,
but that adds a lot of extra cells if my table is larger than 2 x 2.
(Sorry about the ASCII graphics.)