Jump to content

Having a horizontal scroll bar for a list box


eva21

Recommended Posts

<head>

<style type="text/css">

div

{

height : 70px;

overflow: auto;

}

</style>

</head>

 

<div>

<?

echo("<Select size=3 MULTIPLE style=width:'235px' style=font-size:'9pt' onchange='getMedia(" . $rows['id'] . ")' name='" . $rows['id'] . "_t[]' id='" . $rows['id'] . "_t'>");

 

This doesnt do what i want. I have a listbox, and the words get really long, and I need a horizontal scroll bar in order to let the user see what is all there. Please help!

style=width:'235px' style=font-size:'9pt'

Well that doesn't work is quite logical as you seem to be making up a new syntax. (Or at least I'm not familiar with it and neither is the Konqueror browser).

 

Styling selects is a pain in the rear (well all forms are hard to style) so try this:

 

<div style="width: 235px; overflow: auto;">
  <select size=3 MULTIPLE style='font-size: 9pt'>
    <option>Man this option is really really long,  it doesn't even fit! on this line and scrolling is required..</option>
  </select>
</div>

 

Looks a bit odd in firefox with the scrollbar on the side, and it seems to be unkillable.

You could use the title attribute on the options to provide the full description as a tooltip instead of making it scrollable.

Don't have access to internet explorer atm (side affect from running linux on 3 systems) so I'm guessing it is as the last solution worked for me in Opera, Firefox and Konqueror (konqueror is webkit, so I assume it would work in safari/chrome as well).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.