you just need to understand html 4.0. object have a width, border and
margin. the border and margin extend beyond the width. so if you make an
object 100px wide with a 2px margin and a 2px border it will be 108px
wide. if you make the width 100% (of the parent), with margin and border
it will be 8px wider than the parent. now if the parent has padding the
control is offset and will extend beyond the parent unless overflow is set.
because you are not setting the borders, margins, and padding, you get
the default, which differs by browser.
-- bruce (sqlwork.com)
wrote:
> I've read a bunch of posts on this and none of the answers are
> legitimate (IMHO) so I thought I'd throw it out there again.
>
> Using the html code below, if you set the doctype to HTML 4.0, and
> view the page in IE 6 or 7, the text element fills the table cell
> perfectly.
> If you change the doctype to XHTML 1.0, the text element extends
> beyond the width of the table cell.
> On the other hand, if you view the page in FireFox, the page displays
> perfectly regardless of which doctype you use.
>
> I'm really looking for a better solution than to set the doctype to
> HTML 4.0. Or perhaps is this just another anomaly in IE?
>
> Please note that I have included both doc type headers. The first
> doctype header is always used so just reverse the order to try each
> one out.
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
> www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <body>
> <table>
> <tr>
> <td width="200">
> <input type="text" style="width:100%" />
> </td>
> </tr>
> </table>
> </body>
> </html>
>