表格和表单的结合示例demo
<!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" xml:lang="zh-cn"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>网页标题</title> <meta name="keywords" content="关键字列表" /> <meta name="description" content="网页描述" /> <link rel="stylesheet" type="text/css" href="" /> <style type="text/css"> .xxdjb{ backGround-color:#e0e0e0; } table{ text-align:center; } </style> <script type="text/javascript"></script> </head> <body>
<!--要提交后端php地址自行修改-->
<form method="post" action="recrive.php"> <table border="1" rules="all" bordercolor="#000000" > <tr> <th colspan="2" height="50">信息登记表</th> </tr> <tr class="xxdjb" height="50"> <td width="50" >姓名</td> <td><input type="text" name="username"/></td> </tr> <tr height="70"> <td>性别</td> <td> <input type="radio" name="sex" value="nan" checked="checked"/>男 <input type="radio" name="sex" value="nv"/>女 </td> </tr> <tr class="xxdjb" height="50"> <td>爱好</td> <td> <input type="checkbox" name="hobby[]" value="kdy"/>看电影 <input type="checkbox" name="hobby[]" value="tyy" checked="checked"/>听音乐 <input type="checkbox" name="hobby[]" value="ly" checked="checked"/>旅游 </td> </tr> <tr height="50"> <td>月薪</td> <td><input type="text" name="salary"/>元</td> </tr> <tr class="xxdjb" height="50"> <td>国籍</td> <td> <select> <option name="nationality" selected="selected" value="中国">中国</option> <option name="nationality" value="美国" >美国</option> </select> </td> </tr> <tr height="50"> <td>备注</td> <td><textarea name="beizhu" cols="#" rows="#"></textarea></td> </tr> <tr> <td colspan="2" height="40"> <input type="submit" value="提交信息"/> <input type="reset" value="重置"/> </td> </tr> </table> </form> </body> </html>