To make this as simple as possible, let's say I have a table with one row and column. The table is stretched to the width of the page. The table has just one cell and in it there are two div elements. Basically it looks like this:
<table style="width: 100%;">
<tr>
<td>
<div style="white-space: nowrap;">Long item that stretches most of the way across the page</div>
<div style="float: right; white-space: nowrap;">Another item that takes up most of the rest of the page</div>
</td>
</tr>
</table>
Now, when the width of the browser window is wide enough, everything fits into a single line. If you shrink the browser window, the second div will eventually wrap under the first and create a second line. I don't want it to create a second line; I want one line and then the horizontal scrollbar to appear when the browser window width gets too small.
Without hard-coding a static width for the table, tr, or td elements, how do I prevent the second div from wrapping to a second line?
techfuzz
<table style="width: 100%;">
<tr>
<td>
<div style="white-space: nowrap;">Long item that stretches most of the way across the page</div>
<div style="float: right; white-space: nowrap;">Another item that takes up most of the rest of the page</div>
</td>
</tr>
</table>
Now, when the width of the browser window is wide enough, everything fits into a single line. If you shrink the browser window, the second div will eventually wrap under the first and create a second line. I don't want it to create a second line; I want one line and then the horizontal scrollbar to appear when the browser window width gets too small.
Without hard-coding a static width for the table, tr, or td elements, how do I prevent the second div from wrapping to a second line?
techfuzz
