I am creating a form using a table with fixed-width columns, and I want the input elements inside the <td> fill the container. I know the CSS block model, and I know that elements will skip using width: 100% , but the problem is with its consistency.
<input> elements expire as expected, but <select> elements dont. This causes my fields to not align correctly. I tried all the properties, such as overflow, display, spaces ... it does not matter. What happens to the <select> element? I see in Firebug that they have the same box model properties with an input element, but they do not display the same.
Im using HTML 5 doctype, and this happens in both Firefox and Chrome.
Right now, I am fixing this with a JS function that selects all elements with a class extension and calculates and sets the static width so that it fits into the container. It perfectly combines form elements. (I had to exclude the <select> elements because their width was already fine ... weird quirk.)
Is there a clean CSS solution for this? I would not want to run this function every time a part of the page is refreshed, for example, on AJAX calls ...
source share