表格如何巢狀表單,如何在用表格給表單排版
阿新 • • 發佈:2019-01-22
表單可以用來傳遞資料,如何和表格結合就可以很方便地排版了~
- 可選的屬性
<html>
<title>form demo
</title>
<body>
<form method="post" action="demo17.html">
<table border=1 cellpadding="20%">
<tr>
<th>name</th>
<th>
<input type="text" name="name" value="lily" size="10">
</th>
</tr>
<tr>
<th>password</th>
<th>
<input type="password" name="psword" size="10">
</th>
</tr>
<tr >
<th>sex</th>
<th>
<input type="radio" name="sex" value="male" checked/> Male
<input type="radio" name="sex" value="female" /> Female
</th>
</tr>
<tr>
<th > hobby</th>
<th>
</th>
</tr>
<tr>
<th>grade</th>
<th>
<select name="grade">
<option value="grade1" selected>1</option>
<option value="grade2">2</option>
<option value="grade3">3</option>
<option value="grade4">4</option>
</select>
</th>
</tr>
<tr>
<th>choice</th>
<th>
<input type="reset"/>
<input type="submit"/>
</th>
</tr>
</table>
</form>
name:
<input type="text" name="name" value="lily" size="10">
<br>
password:
<input type="password" name="psword" size="10">
<br>
sex:
<input type="radio" name="sex" value="male" checked/> Male
<input type="radio" name="sex" value="female" /> Female
<br>
hobby:
<input type="checkbox" name="swim" value="yes"/> I like swimming
<input type="checkbox" name="hike" value="yes" checked /> I like hiking
<br>
grade:
<select name="grade">
<option value="grade1" selected>1</option>
<option value="grade2">2</option>
<option value="grade3">3</option>
<option value="grade4">4</option>
</select>
<br>
<input type="reset"/>
<input type="submit"/>
<br>
</form>
</body>
</body>
</html>