tags:

views:

36

answers:

2

i am looking for a solution for having cellspacing between each of the rows of a table but not between the columns. is this possible ?

+4  A: 

You can separate rows in a table using the border-spacing property:

table {
    border-collapse:separate;
    border-spacing: 0 10px;
}

This sets the space between columns to zero and the space between rows to 10px. If you supply one argument, then that length will be applied to both the vertical spacing and the horizontal spacing; with two arguments, the first will set the horizontal spacing and the second will set the vertical spacing.

derekerdmann
+4  A: 

The border-spacing is nice, but IE6/7 doesn't understand that. If you want to cover them as well, then rather do:

table { 
    border-collapse: collapse;
}
td {
    border: 10px solid white; /* Or any color which matches table's bgcolor */
    border-width: 10px 0;
}
BalusC