|
Posted by dorayme on 06/28/07 18:14
In article
<1183042357.606730.12700@m36g2000hse.googlegroups.com>,
Froefel <hansdeschryver@gmail.com> wrote:
> I'm looking for a way to restrict a listbox from resizing
> horizontally.
>
> The listbox sits within a <td> and has a style="width=100%;"
>
> This makes sure that the listbox is always as wide as its (fixed-
> width) <td>, nomatter how short the text of the items.
> However, when the text of an item is longer than the listbox width,
> the listbox is resized horizontally to accommodate the text. I would
> like to prevent that from happening, so that either the text gets cut
> off, or a horizontal scroll bar appears.
>
> Can this be done with CSS or any other way?
>
Your meaning is not clear. Show a URL of what you are trying.
Most people don't like code - but you don't even give this. What
can "text of an item is longer than the listbox width" mean? Text
wraps. Anyway, of all my browsers, interestingly enough, iCab is
odd man out in rendering:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Question</title>
<style type="text/css">
* {margin: 0; padding: 0;}
..listContainer {width: 600px; border: 1px solid #000; padding:
2px; padding-left: 2em;}
ul {width: 100%; border: 1px solid #c00;"}
</style>
</head>
<body>
<table><tr><td class="listContainer"><ul>
<li>Item short</li>
<li>Item longer</li>
<li>Item that goes on or quite some time, partly being a
history of the world....</li>
</ul></td>
<td>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque augue.Suspendisse consectetuer ...</td></tr></table>
</body>
</html>
by taking to heart and seriously the 600px width of the cell.
Horizontal scroll bars come up.
--
dorayme
[Back to original message]
|