<h2>表单</h2>
<hr />
<form action="">
<table>
<tr>
<td><h3>姓名:</h3></td>
</tr>
<tr>
<td>姓:</td>
<td><input type="text" name="" /></td>
</tr>
<tr>
<td>名:</td>
<td><input type="text" name="" /></td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td><h3>性别:</h3></td>
</tr>
<tr>
<td><input type="radio" name="sex" />男</td>
</tr>
<tr>
<td><input type="radio" name="sex" />女</td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td><h3>班级:</h3></td>
</tr>
<tr>
<td>
<select>
<option>计科1班</option>
<option>计科2班</option>
<option>计科3班</option>
</select>
</td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td><h3>寝室:</h3></td>
</tr>
<tr>
<td>
<select>
<option>12</option>
<option>13</option>
<option>14</option>
</select>
</td>
<td>舍<input type="text" name=""></td>
</tr>
</table>
</form>
</body><body>
<h2>表单</h2>
<hr />
<form action="">
<table>
<tr>
<td><h3>姓名:</h3></td>
</tr>
<tr>
<td>姓:</td>
<td><input type="text" name="" /></td>
</tr>
<tr>
<td>名:</td>
<td><input type="text" name="" /></td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td><h3>性别:</h3></td>
</tr>
<tr>
<td><input type="radio" name="sex" />男</td>
</tr>
<tr>
<td><input type="radio" name="sex" />女</td>
</tr>
<tr>
<td><h3>班级:</h3></td>
</tr>
<tr>
<td>
<select>
<option>计科1班</option>
<option>计科2班</option>
<option>计科3班</option>
</select>
</td>
</tr>
<tr>
<td><h3>寝室:</h3></td>
</tr>
<tr>
<td>
<select>
<option>12</option>
<option>13</option>
<option>14</option>
</select>
</td>
<td>舍<input type="text" name=""></td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
</table>
</form>
</body><body>
<h2>表单</h2>
<hr />
<form action="">
<table>
<tr>
<td><h3>姓名:</h3></td>
</tr>
<tr>
<td>姓:</td>
<td><input type="text" name="" /></td>
</tr>
<tr>
<td>名:</td>
<td><input type="text" name="" /></td>
</tr>
</table>
<hr />
<table>
<tr>
<td><h3>性别:</h3></td>
</tr>
<tr>
<td><input type="radio" name="sex" />男</td>
</tr>
<tr>
<td><input type="radio" name="sex" />女</td>
</tr>
</table>
<hr />
<table>
<tr>
<td><h3>班级:</h3></td>
</tr>
<tr>
<td>
<select>
<option>计科1班</option>
<option>计科2班</option>
<option>计科3班</option>
</select>
</td>
</tr>
</table>
<hr />
<table>
<tr>
<td><h3>寝室:</h3></td>
</tr>
<tr>
<td>
<select>
<option>12</option>
<option>13</option>
<option>14</option>
</select>
</td>
<td>舍<input type="text" name=""></td>
</tr>
</table>
</form>
</body>
首先,table里的内容都需要放在td里,你的内容错乱,就是因为内容没用td包裹,会自动提前到前边。
如果想要在table里边添加hr,一个是需要用td包裹,再是td需要合并单元格。但是hr长度最多跟table这么大。想加宽可以给hr添加width属性。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)