【发布时间】:2013-12-24 11:48:58
【问题描述】:
如何分别更改不同 TD 的宽度?这意味着,如果我更改 TD 的宽度,列的宽度不会受到影响,而只会影响行的宽度。例如:
http://i.imgur.com/XPNG7Gi.png
我怎样才能做到这一点?我已经尝试过分别更改每个 TD 的宽度,但是,当我这样做时,它会更改整个列本身的宽度。
这是我的表的代码:
<table>
<tr>
<td>Name:</td>
<td>
<input type="text" name="user" placeholder="Your Name" maxlength="20">
</td>
</tr>
<tr>
<td>Email Address:</td>
<td>
<input type="text" name="email" placeholder="Your Email Address">
</td>
</tr>
<tr><td>Message:</td></tr>
<tr>
<td colspan="2">
<textarea rows="10" cols="50" name="message" maxlength="500"></textarea>
</td>
</tr>
<tr><td colspan="2"><center><img src="test.php" alt="" /></center></td></tr>
<tr><td style="text-align:right">Enter the Code:</td><td><input id="security_code" name="security_code" type="text" placeholder="Enter the Code Above"/></td></tr>
</table>
【问题讨论】:
标签: html css width html-table