I'd like to get the following sizing behavior on a row of data. The 'abcd...' field is a variable size, and I'd like as much of it displayed as possible after all the other fields have taken up their required space. The '0123...' field is a variable size, and I'd like fully displayed right after the first field. The 'X' field is a known fixed size, and I'd like it pinned to the right side.
| abcdefghijklmnopqrstuvwxyz | 0123456789 | | X |
| abcdefghijklmnopqrstuvwxyz | 0123456789 | | X |
| abcdefghijklmnopqrstuvwxyz | 0123456789 | | X |
| abcdefghijklmnopqrstuvwxyz | 0123456789 | X |
| abcdefghijklmnopqrstuvwx | 0123456789 | X |
| abcdefghijklmnopqrstuv | 0123456789 | X |
| abcdefghijklmnopqrst | 0123456789 | X |
I've tried many table-based and floating div approaches, but nothing works right across all browsers. Here's an approach that works with webkit but not others.
<div style="width:300px">
<div style="float:right;width:20px">
X
</div>
<div style="overflow:hidden">
<div style="float:left">
<div style="overflow:hidden">
<div style="float:right">
0123456789
</div>
<div style="overflow:hidden;white-space:nowrap">
abcdefghijklmnopqrstuvwxyz
</div>
</div>
</div>
</div>
</div>
Some of the nested divs are not required by webkit, but I was trying to get this working in other browsers. Anyone have ideas on how to solve this? Thanks!