一文清晰了解表格表单

 一、表格

要想实现下述内容: 

代码如下:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="GBK">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <table border="1px" cellspacing="0" width="600px">
        <tr>
            <th>ID</th>
            <th>Logo</th>
            <th>name</th>
            <th>names</th>
        </tr>
        <tr>
            <td> <img src="http://gips3.baidu.com/it/u=1821127123,1149655687&fm=3028&app=3028&f=JPEG&fmt=auto?w=720&h=1280" width="100px"></td>
            <td>这是普通</td>
            <td>的表格内容</td>
            <td style="text-align: center">居中</td>
        </tr>
    </table>
</body>

</html>

二、表单

要想实现下述表单: 

 

HTML代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="GBK">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
     <!-- form表单标签:
        action:表单提交的url,默认当前页面
        method:提交方式——get在url后拼接数据——post在消息体中传递,无大小限制 -->
         <!-- name属性是必须,否则无法提交 -->
    <form action="" method="post">
        用户名:<input type="text" name="username"><br><br>
        学号:<input type="text" name="age"><br><br>
        密码:<input type="password" name="password"><br><br>
        性别:<label><input type="radio" name="gender" value="1">男</label>
              <label><input type="radio" name="gender" value="2">女</label><br><br>
        爱好:<label> <input type="checkbox" name="habby" value="java">java</label>
            <label> <input type="checkbox" name="habby" value="C++">C++</label>
            <label> <input type="checkbox" name="habby" value="python">python</label><br><br>
        生日:<input type="date" name="bir"><br><br>
        时间:<input type="time" name="time"><br><br>
        日期时间:<input type="datetime-local" name="datatime"><br><br>
        邮箱:<input type="email" name="email"><br><br>
        年龄:<input type="number" name="age"><br><br>
        学历:<select name="degree">
                <option value="">--------请选择--------</option>
                <option value="1">大专</option>
                <option value="2">本科</option>
                <option value="3">硕士</option>
                <option value="4">博士</option>
            </select><br><br>
    描述:<textarea name="description" cols="30" rows="10"></textarea> <br><br>
            <input type="hidden" name="id" value="1">

        <input type="button" value="按钮">
        <input type="reset" value="重置">
        <input type="submit" value="提交"><br>
    </form>
</body>
</html>

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-12 11:34:02       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-12 11:34:02       71 阅读
  3. 在Django里面运行非项目文件

    2024-07-12 11:34:02       58 阅读
  4. Python语言-面向对象

    2024-07-12 11:34:02       69 阅读

热门阅读

  1. 【React】监听浏览器返回事件

    2024-07-12 11:34:02       26 阅读
  2. 【C语言】高低字节的分分合合 !

    2024-07-12 11:34:02       31 阅读
  3. Pip: Python的包管理器

    2024-07-12 11:34:02       26 阅读
  4. spring 中的路径匹配

    2024-07-12 11:34:02       15 阅读
  5. 【linux服务器ssl证书过期替换】

    2024-07-12 11:34:02       16 阅读
  6. python使用python-docx库处理图片白框问题

    2024-07-12 11:34:02       21 阅读
  7. 力扣刷题35.搜索查找位置

    2024-07-12 11:34:02       17 阅读
  8. C#面 :请列举官方常用的中间件?

    2024-07-12 11:34:02       22 阅读
  9. AI学习指南机器学习篇-K均值聚类模型训练与预测

    2024-07-12 11:34:02       23 阅读
  10. git stash

    git stash

    2024-07-12 11:34:02      21 阅读
  11. 【React Hooks原理 - useEffect、useLayoutEffect】

    2024-07-12 11:34:02       21 阅读
  12. 软设之观察者模式

    2024-07-12 11:34:02       22 阅读
  13. 交易积累-Cloudflare

    2024-07-12 11:34:02       21 阅读
  14. 使用Zipkin与Spring Cloud Sleuth进行分布式跟踪

    2024-07-12 11:34:02       28 阅读