CSS - How do I style a select to fully occupy the td it is in


Tags: css

Problem :

This is a simplified version of an html table I have: (The table is RTL)

......
<tr>
    <td>
        <select>
            <option>A New Think Pad</option>
            <option>OptB</option>
            <option>OptC</option>
        </select>
    </td>
</tr>    .....
<tr>
    <td>
        <select>
            <option>Poker</option>
            <option>B</option>
            <option>C</option>
        </select>
    </td>
</tr>

My problem is that it ends out looking something like this:

alt text

How do i get the option below (Poker) to size itself to the size of the td.
(I do not know the size of the td in advance)

I have tried:

select, option { width:inherit;}

But it does not seem to do the job.

Thanks in advance and be happy, Julian



Solution :

Maybe:

select { width: 100%; }

    CSS Howto..

    how can i style processing.js element?

    How to use ­ and the CSS “hyphens” property together?

    How to put a
  • over an
    • How to set MenuItem to corrent width in asp.net

      How to make chrome respect tables with fixed column width

      Ionic 2.0.0-beta.24 how can i import node_module css files without ionic.config.js

      How to change the font-size of the part of textarea text in HTML,CSS?

      How to offset content under a navbar when using height:100%?

      HTML CSS, how to create a Side bar or column

      How to set body attribute in css using angularjs?

      how to remove all spaces from a file

      How to improve this code to combine/compress CSS using PHP [closed]

      CSS: how to remove the indent of list items shown in Firefox

      webpage works well on all browsers except Android Browser, which shows fonts with increased size

      Using jQuery, how to find out if CSS selector “input[type=text]” is natively supported by browser?

      How to remove css property from last child element?

      ASP.NET How to set Text to the right side of image

      How to remap CSS shortcut key in Mac Bluefish text editor

      How to add CSS inline in Vaadin?

      How to exclude last child in css psuedo class selector

      how to style the html contents inside a php include file?

      How do you group similar n-th child selectors? [duplicate]

      How to make a background using CSS gradient with flat color?

      How to put borders to
    • onclick in css Tabs
    • CSS: How to make a div block *not* take space in its parent container

      Two navbar-inner on the same page how to change the padding of each?

      CSS: how do I add Twitter Bootstrap to an existing web page with it's own CSS?

      How do I align div vertically like in picture

      How long can a webpage be?

      How to use sprite images in html/css and toggle change with jQuery