HTML 表格(form/table)

本文介绍了一个用户注册表单的设计方案,包括表单布局、样式设置及交互元素的使用。表单采用HTML与CSS实现,涵盖了基本的输入验证与用户信息收集功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

实现一个表格:
这里写图片描述

3.css:
table,tr,td{
    margin:0 auto;
    border:1px solid;
    border-style:groove;(凹陷效果)
}


input{
    border-style:groove;

    background:lightblue;
    color:red;
}

a:link {color:blue;} /* 未访问的链接 */
a:visited {color:gray;} /* 已访问的链接 */
a:hover {color:red;} /* 鼠标划过链接 */
a:active {color:black;} /* 已选中的链接 */
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户注册</title>
    <link href="3.css" type="text/css" rel="stylesheet"/>
</head>
<body>
    <form action="reg_check.jsp" method="post">
        <table>
            <tr>
                <td colspan="2" align="center">
                    用户注册信息
                </td>
            </tr>
            <tr>
                <td class="left">
                    用户名
                </td>
                <td style="width:250px">
                    <input type="text" name="user" style="width:150px"/>
                </td>
            </tr>
            <tr>
                <td class="left">
                    密&nbsp&nbsp&nbsp码
                </td>
                <td style="width:250px">
                    <input type="password" name="pw" style="width:150px"/>
                    </td>
            </tr>
            <tr>
                <td class="left">
                    校验密码
                </td>
                <td style="width:250px">
                    <input type="password" style="width:150px" maxlengh="16"/>
                </td>
            </tr>
            <tr>
                <td class="left">
                    籍&nbsp&nbsp&nbsp贯
                </td>
                <td>
                    <select name="place">
                        <option>
                            浙江
                        </option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>
                    兴趣爱好
                </td>
                <td class="left">
                    <input type="checkbox"/>篮球
                    <input type="checkbox"/>足球
                    <input type="checkbox"/>书法
                    <input type="checkbox"/>音乐
                    <br>
                    <input type="checkbox"/>绘画
                    <input type="checkbox"/>散打
                    <input type="checkbox"/>瑜伽
                    <input type="checkbox"/>其他
                </td>
            </tr>
            <tr>
                <td>
                    政治面貌
                </td>
                <td>
                    <input type="radio"/>党员
                    <input type="radio"/>团员
                    <input type="radio"/>群众
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <button type="button">
                        提交
                    </button>
                    <button type="button">
                        重置
                    </button>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="2">
                    <a href="">注册帮助信息请点击这里</a>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>

不建议使用的标签:
<center> 不赞成使用。定义居中文本。
<font> 不赞成使用。定义文字的字体、尺寸和颜色。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值