I am trying to create a two fixed column table (freeze the first two columns), that respects the widths of the td elements that I give them.
When the two columns get fixed, the widths of the columns are randomly set.
<div id="tableContainer">
<table class="all-table">
<colgroup>
<col style="width:30px;" />
<col style="width:30px;" />
<col style="width:180px;" />
<col style="width:180px;" />
<col style="width:180px;" />
<col style="width:30px;" />
</colgroup>
<thead>
<tr>
<td class="td-fixed gray-background">a</td>
<td class="td-fixed td-fixed-margin gray-background">a</td>
<td class="gray-background">aaaaaaaaaaaa</td>
...
</tr>
...
</thead>
<tbody>
<tr>
<td class="td-fixed white-background">a</td>
<td class="td-fixed td-fixed-margin white-background" >a</td>
<td>aaaaaaaaaaaa</td>
...
</tr>
<tr>
<td class="td-fixed white-background">a</td>
<td class="td-fixed td-fixed-margin white-background">a</td>
<td >aaaaaaaaaaaa</td>
...
</tr>
...
</tbody>
</table>
</div>
The CSS part can be found in the link.
http://jsfiddle.net/pcmhd42e/8/
http://jsfiddle.net/pcmhd42e/9/ - updated version from gewh
Could not find a workaround that would work with CSS, the solution does not use Bootstrap.