html 表格标签与表单

<table>:最外层
<tr>:定义表格行
<th>:定义表头
<td>:定义表格单元
<caption>:定义表格标题
语义化标签:tHead  tBody tFood

表格属性:

border:表格边框

cellpadding:单元格内的空间

cellspacing:单元格之间的空间

rowspan:合并行

colspan:合并列

align:左右对齐方式(left、center、right)

valign:上下对齐方式(top、middle、bottom)

表单标签

<form>
<input>:标签用于搜集用户信息,根据不同的type属性值,展示不同的控件,如输入框、密码框、复选框等
<form action = "http://www.baidu.com>  //提交的位置
        <h1>输入框:</h1>
        <input type = "text" placeholder = "请输入用户名">
        <h1>密码框:</h1>
        <input type = "password" placeholder = "请输入密码">
        <h1>复选框</h1>
        <input type = "checkbox" checked>苹果    //checked的意思是已经被提前选了
        <input type = "checkbox" disabled>香蕉   //disabled的意思是不能选
        <h1>单选框</h1>
        <input type = "radio" name = 1>男   //radio应当与name配套使用,只有name的值一样时才能起到单选的作用
        <input type = "radio" name = 1>女
        <h1>上传文件</h1>
        <input type = "file">
        <h1>提交</h1>
        <input type = "submit">
        <h1>重置</h1>
        <input type = "reset">

    </form>

表格与表单组合使用

 <form>
        <table border = "1" cellpadding = "30">
            <tBody>
                <tr>
                    <td rowspan = "4">总体信息</td>
                    <td colspan = "2">用户注册</td>
                </tr>
                <tr>
                    <td>用户名:</td>
                    <td><input type = "text" placeholder = "请输入用户名"></td>
                </tr>
                <tr>
                    <td>密码:</td>
                    <td><input type = "password" placeholder = "请输入密码"></td>
                </tr>
                <tr>
                    <td colspan = "2">
                        <input type = "submit">
                        <input type = "reset">
                    </td>
                </tr>
            </tBody>
        </table>
    </form>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值