Reputation: 12036
How do I force table to take some space for headers (vertical and horizontal) and make all other cells (<td>
) equal size no matter what?
<table>
<tr>
<th></th><th...
</tr>
<tr>
<th></th><td...
</tr>
<tr...
</table>
Would like all grey squares to have same size... any way to do it via CSS?
Upvotes: 1
Views: 2739
Reputation: 123377
For cell of equal size add this rule
table {
table-layout: fixed;
}
Further information on MDN
If you also need to reduce the height of your cells just remove height=100%
from the table and set an height to the <th>
elements
Upvotes: 6