Reputation: 433
html,body{height:100%}
.mwh{width:100%;height:100%}
.w75c{width:75%}
.bor,.bor td,.bor th{border:1px teal dashed}
<table class="mwh bor">
<tr>
<td></td>
<td>body</td>
<td></td>
</tr>
</table>
When the table has the bor
class the 1st and 3rd cells display thier respective 12.5% width, yet when the bor
class is removed both side cells collapse unless their is content within them like <td> </td>
.
is there a way to have it so as these side cells do not collapse?
Upvotes: 1
Views: 1349
Reputation: 18099
Add
table-layout: fixed;
to the table css. You will not need the fixed width then.
Demo: http://jsfiddle.net/lotusgodkk/GCu2D/812/
CSS:
html, body {
height:100%
}
.mwh {
width:100%;
height:100%;
table-layout:fixed
}
Upvotes: 3
Reputation: 458
add
td {width:30%}
html,body{height:100%}
.mwh{width:100%;height:100%}
.w75c{width:75%}
.bor,.bor td,.bor th{border:1px teal dashed}
td {width:30%}
<table class="mwh bor">
<tr>
<td></td>
<td>body</td>
<td></td>
</tr>
</table>
Upvotes: 0