在HTML中删除表中的缩进

时间:2013-12-04 21:57:20

标签: html html-table indentation

我想将文字“你忘记了用户名”缩进到“用户名”文字的位置。

它的外观截图,你会理解我的意思:

http://i.imgur.com/06tzFPt.png

</td>
</tr></tbody></table><table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFBF00">
<tbody><tr>
</tr><tr>
<form id="form1" method="post" action="checklogin.php"></form>
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#D8D8D8">

<tbody><tr>
<td colspan="3"><strong>

</strong></td>
</tr>
<tr>
<td colspan="3"><strong>Forgot your password? </strong></td>
</tr>
<tr>
<td width="78">Username</td>
<td width="6">:</td>
<td width="294"><input name="myusername" type="text" id="myusername"></td>
</tr>
<tr>

</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Did you forget <a href=http://www.google.com>your username</a> instead? <br></br>
<input type="submit" name="Submit" value="Submit">

</tr>
</tbody></table>
</td>

</tr>
</tbody></table>
</div>
</div></body></html>

1 个答案:

答案 0 :(得分:1)

我相信您正在寻找colspan

在“你忘了......”列之前删除两列,如下所示:

以下是一个示例:http://jsfiddle.net/nKx3U/

<tr>
    <td colspan="3">Did you forget <a href=http://www.google.com>your username</a> instead? <br></br>
    <input type="submit" name="Submit" value="Submit">
</tr>

我也不确定桌子是否是最佳选择。