yemerra
yemerra

Reputation: 1342

Disabling border-collapse for single columns and rows

I have a little problem with my table. I want that the first column and the first row has separate borders, but the rest of the table has collapsed borders. I tested to use the border-collapse attribute on td's and th's but it seems like that it just works for the table tag. What do I have to do to realize this?

My table:

<table id=sptable>
...
</table>

My CSS:

table#sptable { border-collapse: collapse;
}

Upvotes: 1

Views: 2047

Answers (1)

Der Vampyr
Der Vampyr

Reputation: 951

Well for the first row you can add an empty row behind it like this:

<tr><td style="height: 20px;"></td></tr>

FIDDLE

EDIT:

Well updated for cols too. FIDDLE (same procedure, adding some th instead of tr)

Upvotes: 2

Related Questions