W3C home > Mailing lists > Public > www-html@w3.org > October 2005

xhtml and input width?

From: Henry Lee <hlee23@gmail.com>
Date: Thu, 27 Oct 2005 04:54:42 +0000
Message-ID: <a57da9960510261312u3b07ef76kb207bc715fa71699@mail.gmail.com>
To: www-html@w3.org
Hi.
 I was just putting some simple input boxes in a table and I don't know what
my error is but I can't get them to line up when I have my page in:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  this is my simple example:
 ***************************************************************
***************************************************************

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style>
<!--
input { width: 250px; }
-->
</style>
</head>

<body>
<table width="510" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr valign="top">
<td>Name<br><input type="text" name="Name"></td>
<td>&nbsp;&nbsp;</td>
<td>Date<br><input type="text" name="Date"></td>
</tr>
<tr valign="top">
<td colspan="3">Test<br><input type="text" name="Test"
style="width:510px;"></td>
</tr>
<tr valign="top">
<td>Name2<br><input type="text" name="Name2"></td>
<td>&nbsp;&nbsp;</td>
<td>Date2<br><input type="text" name="Date2"></td>
</tr>
</tbody>
</table>
</body>
</html>
***************************************************************
 ***************************************************************
 If you save it in html and open it in a browser, you'll notice that the
Test input box does not line up with the rest of the input boxes at the end..
Also, all the input boxes seem longer than what's expected.
 But if i use this in my page, it works fine. (As it should.)
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
....
 I'm just not sure why the big difference or if there's an error in my
example.
 Thanks,
 Henry
Received on Thursday, 27 October 2005 05:36:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:16:04 GMT