当前位置: 首页 > news >正文

HTML中的表单Form实现居中

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <link rel="icon" type="text/css" href="./img/favicon.png"/>
        <title></title>
    </head>
    <body>
        <center>
        <form action="Success.html" target="_blank" method="get">
            <table border="0" cellspacing="" cellpadding="">
                <tr>
                    <td><label for="firstname">名字:</label></td>
                    <td><input type="text" name="firstname" id="firstname" required="required" value="" /></td>
                </tr>
                <tr>
                    <td><label for="lastname">姓氏:</label></td>
                    <td><input type="text" name="lastname" id="lastname" required="required" value="" /></td>
                </tr>
                <tr>
                    <td><label for="login name">登录名:</label></td>
                    <td><input type="text" name="login name" required="required" pattern="^\w{4,8}$" id="login name" value="" />(可包含a-z、0-9和下划线)@ www.haoshilao.net</td>
                </tr>
                <tr>
                    <td><label for="password">密码:</label></td>
                    <td><input type="password" name="password" required="required" pattern="^[a-zA-Z]\w{5,17}$" id="password" value="" />(至少包含6个字符)</td>
                </tr>
                <tr>
                    <td><label for="password2">再次输入密码:</label></td>
                    <td><input type="password" name="password2" required="required" pattern="^[a-zA-Z]\w{5,17}$" id="password2" value="" /></td>
                </tr>
                <tr>
                    <td><label for="myEmail">电子邮箱:</label></td>
                    <td><input type="email" name="myEmail" id="myEmail" value="" />(必须包含@字符@ www.xuepai.net)</td>
                </tr>
                <tr>
                    <td><label>性别:</label></td>
                    <td>
                        <input type="radio" name="sex" id="" value="male" />男<img src="./img/Male.gif" >
                        <input type="radio" name="sex" id="" value="female" />女<img src="./img/Female.gif" >
                    </td>
                </tr>
                <tr>
                    <td><label>头像:</label></td>
                    <td><input type="file" name="myFile" /></td>
                </tr>
                <tr>
                    <td><label>爱好:</label></td>
                    <td>
                        <input type="checkbox" name="hobby" id="" value="运动" />运动
                        <input type="checkbox" name="hobby" id="" value="聊天" />聊天
                        <input type="checkbox" name="hobby" id="" value="玩游戏" />玩游戏
                    </td>
                </tr>
                <tr>
                    <td><label>出生日期:</label></td>
                    <td>
                        <input type="text" size="1" name="year"placeholder="yyyy" id="" value="" />年
                        <select name="month">
                            <option value ="0">[选择月份]</option>
                            <option value ="1">1月</option>
                            <option value ="2">2月</option>
                            <option value ="3">3月</option>
                            <option value ="4">4月</option>
                            <option value ="5">5月</option>
                            <option value ="6">6月</option>
                            <option value ="7">7月</option>
                            <option value ="8">8月</option>
                            <option value ="9">9月</option>
                            <option value ="10">10月</option>
                            <option value ="11">11月</option>
                            <option value ="12">12月</option>
                        </select>
                        <input type="text" size="1" name="day" placeholder="dd"/>日
                    </td>
                </tr>
            </table>
            <input type="image" src="img/submit.gif" value="提交" />
            <input type="image" src="img/reset.gif" onclick="reset();return false;" value="重填" />    
        </form>
        </center>
    </body>
</html>

若觉得左边的标签左对齐不好看,也可以在 < td >标签中加入align=“right”,使文字右对齐

http://www.jsqmd.com/news/201025/

相关文章:

  • 强烈安利8个AI论文平台,MBA高效写作必备!
  • try111
  • 基于Springboot的克州旅游网站的设计与实现(毕业设计项目源码+文档)
  • 考虑充电负荷空间可调度特性的分布式电源与电动汽车充电站联合配置方法Matlab实现
  • 基于SpringBoot的信访管理系统毕业设计项目源码
  • 从1000并发到10万+:充电桩平台的效率革命,靠的是这三个核心动作
  • HTML通过表单实现酒店筛选功能代码
  • 基于SpringBoot的协同过滤推荐算法的线上安全教育平台毕业设计项目源码
  • 【无人机控制】同轴倾转旋翼三轴无人机的非线性建模和控制,混合反步滑模分层控制方案以及EKF和UKF估计附matlab代码
  • 2026最新瑜伽面料品牌top5推荐!服务覆盖广东广州义乌福建等地优质公司及厂家选择指南,功能性与品质兼具助力运动服饰升级 - 全局中转站
  • 想超越竞品的AI搜索排名,该选什么样的AI GEO优化公司? - 奇林智媒GEO
  • 分时电价环境下用户负荷需求响应分析方法Matlab代码
  • vue 如何给任意组件使用右键菜单,全局右键菜单
  • 本地私有知识库新选择:访答的优势解析
  • 开发测试人员必备网站整合:一步到位,果断收藏了!
  • Spring-boot读书笔记一where is rating() from
  • 计算机深度学习毕设实战-基于卷神经网络的web网页html版通过CNN卷积神经网络对盆栽识别
  • 计及需求响应和电能交互的多主体综合能源系统主从博弈优化调度策略Matlab代码
  • docker的常用命令
  • 少儿编程培训哪家好:机构详细对比与推荐 - 品牌测评鉴赏家
  • html+css实现赛博朋克风格按钮代码
  • 港口集装箱起重机防摇辅助系统
  • 深度学习计算机毕设之基于python机器学习web网页html版通过CNN卷积神经网络对盆栽识别
  • 2026最新运动面料品牌top5推荐!服务覆盖广东广州义乌福建等地优质公司及厂家选择指南,功能性与品质兼具助力运动服饰升级 - 全局中转站
  • I创业颠覆认知——为什么传统产品经理正在消亡,三位超级个体如何重塑产品开发
  • 语音情绪分析让抑郁预警提前一个月
  • 最新流出!7款AI论文神器,知网查重一把过!
  • k8s的常用组件,和命令
  • 2026最新瑜伽面料品牌top5推荐!服务覆盖广东广州义乌福建等地优质公司及厂家选择指南,品质与功能兼具助力服饰产业升级 - 全局中转站
  • 第一章:C语言程序 Pro