Does anyone know why the input elements with a width of 100% go over the table\'s cells border.
In the simple example below input box go over the table\'s cells border,
The problem with things like width:95%; is that they don't look right in wide flexible layouts (because 5% can then be like 30 pixels).
The following solutions works very well for me (tested in Firefox, IE 9, Safari):
(added the colors to make it easier to notice the correct padding)
The trick is to wrap the input with two divs, the outer has a 3px margin (which makes it 3px smaller than the td), the inner has a 3px padding. This makes the input 6px smaller than the td, which is what you wanted to begin with.
I am not sure about the mechanics of this, but it works.
In this simple example, it also works with just a single div with right margin 6. However, in the case of my web application, only the above solution works.