实现如上图所示的表单.
代码如下:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>表单标签</title>
</head>
<body>
<table border="1px" align="center">
<form>
<tr>
<td>用户名:</td>
<td><input name="userName" type="text" /></td>
</tr>
<tr>
<td>密码:</td>
<td><input name="password" type="password" /></td>
</tr>
<tr>
<td>性别:</td>
<td> 男<input name="sex" value="man" type="radio" checked="checked"/> 女<input name="sex" value="woman" type="radio" /></td>
</tr>
<tr>
<td>爱好:</td>
<td>篮球<input name="hobit" value="篮球" type="checkbox" />
足球<input name="hobit" value="足球"type="checkbox" />
羽毛球<input name="hobit" value="羽毛球" type="checkbox" />
乒乓球<input name="hobit" value="乒乓球" type="checkbox" />
</td>
</tr>
<tr>
<td>来自哪个城市:</td>
<td><select name="city"/>
<option value="NJ">南京</option>
<option value="HF">合肥</option>
<option value="HZ">杭州</option>
<option value="SH">上海</option>
</select>
</td>
</tr>
<tr>
<td>大头照:</td>
<td><input type="file"/></td>
</tr>
<tr>
<td>自我介绍:</td>
<td><textarea name="intro" rows="5" cols="30" /></textarea></td>
</tr>
<tr >
<td colspan="2" align="center"><input value="提交数据" type="submit" /><input value="重置" type="reset" /></td>
</tr>
</form>
</table>
</body>
</html>