Reputation: 1820
I have a table with 8 columns inside, I know, that 3 last columns will always be 32 pixel wide, as they contain always the same content. I need to make rest 5 columns equally sized and fill the rest of the space left by fixed td's.
I have following css:
.myTable{
width:100%;
border-color:black;
border-width:1px;
}
.fixedTd{
width:32px;
}
and my markup:
<table class="myTable">
<tr>
<td>Some short content</td>
<td>Some slightly longer content inside</td>
<td>Some very very loooooooong content to show, that columns are not equally sized</td>
<td>Not so long content</td>
<td>Tiny content</td>
<td class="fixedTd"></td>
<td class="fixedTd"></td>
<td class="fixedTd"></td>
</tr>
</table>
I've tried adding table-layout:fixed;
to table class, but in this case fixedTd
does not override the style - all the tds become equal width.
Any ideas how to achieve the result I expect?
Upvotes: 1
Views: 429