Here is the code:
<table style='margin-left: auto; margin-right: auto; text-align: right;'>
<tr>
<td style='vertical-align: top;'>Title:</td>
<td style='width: 400px;'><input type='text' style='border: 1px solid black; width: 100%;' />
</tr>
<tr>
<td style='vertical-align: top;'>Content:</td>
<td><textarea style='border: 1px solid black; width: 100%;' rows='7'></textarea></td>
</tr>
</table>
Here is what it looks like in Opera and FireFox (in Linux):
http://files.quickmediasolutions.com/nuisance/opera.png
http://files.quickmediasolutions.com/nuisance/firefox.png
But then in Chrome (also in Linux):
http://files.quickmediasolutions.com/nuisance/chrome.png
As you can see, the first text box is not the right width 🙁
How can I fix this?
Update: here is a live page that demonstrates the problem.
Aha! Now that you’ve posted a live link, this is much more clear.
The problem is, your
textareahas a padding of 2px from left and right. Therefore, it’s right edge is calculated as2px + 100%, which evaluates to “2px to the right from thetd‘s right edge” (becausetd‘s right edge is 100%).(I hope this is clear enough; I’m trying my best 🙂
To fix this, either put
padding: 0on the textarea, or putpadding: 0 2pxon the input.