I have a table on my layout that has 5 columns, 3 of them should be a fixed width in px, and the other 2 should be fluid.
At first it sounded simple, but the problem is that the two columns of liquid should behave differently.
The last column should be stretched as much as possible to fit its contents, so they never hide, but should not leave empty space. And the middle column should occupy all the free space that it can find, but also overflow to hidden if the latter needs to be increased.

I tried to do this work with css, but I was not able to get it to work ... Is there a way to do this with pure css or do I need js?
EDIT
This is what I got so far:
HTML
<table> <tr> <td class="fixed">fixed</td> <td class="fixed">fixed</td> <td class="fluid hidden">fluid</td> <td class="fixed">fixed</td> <td class="fluid visible">this content should always be visible</td> </tr> </table>
CSS
table{ width: 100%; table-layout: fixed; } td{ padding: 10px; white-space: nowrap; } .fixed{ background-color: #ddd; width: 60px; } .fluid{ background-color: #aaa; } .visible{ } .hidden{ overflow:hidden; }
http://jsfiddle.net/KzVbX/
It works almost as expected. Except for the last column.
html css
arvere
source share