分步表单如何实现 html_HTML表格入门的分步指南

分步表单如何实现 html

by Abhishek Jakhar

通过阿比舍克·贾卡(Abhishek Jakhar)

HTML表格入门的分步指南 (A step-by-step guide to getting started with HTML tables)

总览 (Overview)

The web is filled with information like football scores, cricket scores, lists of employee names and email addresses. HTML tables enable you to display information in what is commonly known as tabular data.

网络上充斥着诸如足球比分,板球比分,员工姓名列表和电子邮件地址之类的信息。 HTML表使您能够显示通常称为表格数据的信息

NOTE: I have already added the Styling using CSS, so my elements will look different. But they will work in exactly the same way.

注意:我已经使用CSS添加了样式,所以我的元素看起来会有所不同。 但是它们将以完全相同的方式工作。

If you want to make your elements look like mine then, you can find my CSS file in the links given below:

如果要使您的元素看起来像我的元素,则可以在下面给出的链接中找到我CSS文件:

If you want to make your elements look like mine then, you can find my CSS file in the links given below:CSS: https://gist.github.com/abhishekjakhar/2ea51dfc0dcf6f6ed0d44ac0e72f9c54

如果要使您的元素看起来像我的元素,则可以在下面的链接中找到我CSS文件: CSS: https : //gist.github.com/abhishekjakhar/2ea51dfc0dcf6f6ed0d44ac0e72f9c54

基本表 (Basic Table)

We can create an HTML table using the table element. It has an opening and closing tag, and it wraps all the table rows and table cells inside of it.

我们可以使用table元素创建一个HTML表。 它具有一个开始和结束标签,并且将所有表行表单元格包装在其中。

<table></table>

Now, let’s type a table row. Tables are made up of rows of information that go across the page. A <tr> element is used to create a table row.

现在,让我们键入一个表格行。 表格由遍及页面的信息行组成。 < tr>元素用于创建表行。

However, there is no element for the table column. Table columns depend on how many table cells are inside each row. A <td> element is used to create a table cell. So basically the number of <td> elements you will add inside the <tr> element is the exact same number of columns you will get inside your table row.

但是,表列没有元素。 表列取决于每行中有多少个表单元格< td>元素用于创建表格单元。 所以基本上麻木呃华氏度 <TD>元素,您将添加插件 IDE中的<tr>元素是完全相同的列数,你会得到你的表行内。

To recap:

回顾一下:

  • <table>: The table element represents data in a series of rows and columns. Tables should only be used for displaying tabular data, and never for page layout.

    <table >:table元素表示一系列行和列中的数据。 表只能用于显示表格数据,而不能用于页面布局。

  • <tr>: The table row element defines a row of cells in a table. Table rows can be filled with table cells and table header cells.

    <tr >:表格行元素定义表格中的单元格行。 表格行可以用表格单元格和表格标题单元格填充。

  • <td>: The table cell element contains data and represents a single table cell. Each table cell should be inside a table row.

    <td >:表单元格元素包含数据并代表单个表单元格。 每个表格单元格应在表格行内。

Note: <table> elements have no attributes. If you’ve worked with tables before, you may have used some attributes in the past. However, they are all now deprecated.

注意: <table>元素没有属性。 如果您以前使用过表,则过去可能使用过一些属性。 但是,它们现在都已弃用。

表标题元素 (Table Header Element)

We’ve created a basic table, but it’s not clear that our first row in the table is actually an attempt to label each of our columns. Right now, the first row simply looks like another row in our table.

我们已经创建了一个基本表,但是尚不清楚表中的第一行实际上是对每个列进行标记的尝试。 现在,第一行看起来就像我们表中的另一行。

We can use a table header element on each of these three columns to tell the browser, search engine crawlers, and screen readers that these are actually headers and not just regular data.

我们可以在这三列中的每一个上使用一个表头元素 ,以告知浏览器,搜索引擎搜寻器和屏幕阅读器这些实际上是头,而不仅仅是常规数据。

Now we will be changing table cells in the first row to a table headers cell. To do that we will replace <td&gt; by <th>.

现在,我们将第一行中的表格单元更改为表格标题单元。 为此,我们将替换< td&g t; b y <th>。

桌子头和身体 (Table Head & Body)

Similar to the structure of our HTML document, where we have a head and a body, we can also add a head and a body to our table. We will definitely not use the same HTML elements because then the syntax will become invalid. For the table, we have <thead> for the head and &lt;tbody&gt; for the body.

与HTML文档的结构类似,在该结构中我们有一个头和一个主体,我们也可以在表中添加一个头和一个主体。 我们绝对不会使用相同HTML元素,因为这样语法将变得无效。 对于该表中,我们有<广告 > FO 第r个 ËHEA d和&L T; TBODY&GT; 为身体。

  • <thead> — The table head element (not to be confused with the table header cell element) defines a set of rows that make up the header of a table.

    <the ad> —表头元素(不要与表头单元格元素混淆)定义了构成表头的一组行。

  • <tbody> — The table body element defines one or more rows that make up the primary contents (or “body”) of a table.

    <tbo dy> —表格主体元素定义了构成表格主要内容(或“主体”)的一行或多行。

桌脚元素 (Table Foot Element)

We have a table head and a table body element. So of course, there’s a table foot element as well. But the question is what is the point of table footer element when we already have the table headers that label columns?

我们有一个表头和一个表主体元素。 因此,当然还有桌脚元素。 但是问题是,当我们已经有了标签列的表头时,表脚元素的意义是什么?

In general, a table footer element should contain a summary of the table. This might be some final cells containing sums, totals and averages for each column. It might also contain some meta information like copyright information or the source of data within a table.

通常,表页脚元素应包含表的摘要。 这可能是一些最终单元格,其中包含每列的总和,总计和平均值。 它也可能包含一些元信息,例如版权信息或表中的数据源。

Now, you would think that the table footer would go at the bottom of the table. However, it actually should go right after the table head element and just before the table body element.

现在,您会认为表格页脚将位于表格底部。 然而,它实际上应该在表头元素之后只是 表体元素之前去。

  • <tfoot&gt; — The table footer element defines a set of rows summarizing the columns of the table.

    <tfoot > —表脚元素定义了一组汇总表各列的行。

字幕元素 (Caption Element)

This element is basically a title for the table, and it should come immediately after the opening table tag. This is nice to add because it quickly summarizes what a table might contain.

这个元素基本上是表格的标题,应该在开始表格标签之后。 添加它很不错,因为它可以快速汇总表可能包含的内容。

Now we have covered the essentials of table elements in HTML.

现在,我们已经介绍了HTML中表格元素的要点。

You can learn more about the tables in the links given below.

您可以在下面的链接中了解有关表格的更多信息。

HTML Table BasicsThat just about wraps up the basics of HTML Tables.developer.mozilla.orgHTML Table Advanced There are a few other things you could learn about HTML Tables.developer.mozilla.org

HTML表基础知识 几乎总结了HTML表的基础知识。 developer.mozilla.org HTML Table Advanced 您还可以了解HTML Tables的其他一些知识。 developer.mozilla.org

I hope you’ve found this post informative and helpful. I would love to hear your feedback!

希望您发现这篇文章对您有帮助。 我希望听到您的反馈!

Thank you for reading!

感谢您的阅读!

翻译自: https://www.freecodecamp.org/news/a-step-by-step-guide-to-getting-started-with-html-tables-7f43b18f962b/

分步表单如何实现 html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/392563.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

laravel mysql pdo,更改Laravel中的基本PDO配置

My shared web host have some problems with query prepares and I want to enable PDOs emulated prepares, theres no option for this in the config\database.php.Is there any way I can do that in Laravel?解决方案You can add an "options" array to add o…

Java多线程-工具篇-BlockingQueue

Java多线程-工具篇-BlockingQueue 转载 http://www.cnblogs.com/jackyuj/archive/2010/11/24/1886553.html 这也是我们在多线程环境下&#xff0c;为什么需要BlockingQueue的原因。作为BlockingQueue的使用者&#xff0c;我们再也不需要关心什么时候需要阻塞线程&#xff0c;什…

leetcode 204. 计数质数

统计所有小于非负整数 n 的质数的数量。 示例 1&#xff1a; 输入&#xff1a;n 10 输出&#xff1a;4 解释&#xff1a;小于 10 的质数一共有 4 个, 它们是 2, 3, 5, 7 。 解题思路 大于等于5的质数一定和6的倍数相邻。例如5和7&#xff0c;11和13,17和19等等&#xff1b…

JAVA 网络编程小记

在进行JAVA网络编程时&#xff0c;发现写入的数据对方等200ms左右才会收到。起初认为是JAVA自已进行了 Cache。进行flush也没有效果。查看JDK代码&#xff0c;Write操作直接调用的native方法&#xff0c;说明JAVA层面并没有缓存。再看flush&#xff0c;只是一个空方法. FileOut…

vue生成静态js文件_如何立即使用Vue.js生成静态网站

vue生成静态js文件by Ondřej Polesn通过OndřejPolesn 如何立即使用Vue.js生成静态网站 (How to generate a static website with Vue.js in no time) You have decided to build a static site, but where do you start? How do you select the right tool for the job wit…

查看文件夹大小的4种方法,总有一种是你喜欢的

有必要检查文件夹的大小,以确定它们是否占用了太多的存储空间。此外,如果你通过互联网或其他存储设备传输文件夹,还需要查看文件夹大小。 幸运的是,在Windows设备上查看文件夹大小非常容易。窗口中提供了图形化和基于命令行的应用程序,为你提供了多种方法。 如何在Windo…

Python 获取服务器的CPU个数

在使用gunicorn时&#xff0c;需要设置workers&#xff0c; 例如&#xff1a; gunicorn --workers3 app:app -b 0.0.0.0:9000 其中&#xff0c;worker的数量并不是越多越好&#xff0c;推荐值是CPU的个数x21&#xff0c; CPU个数使用如下的方式获取&#xff1a; python -c impo…

多种数据库连接工具_20多种热门数据工具及其不具备的功能

多种数据库连接工具In the past few months, the data ecosystem has continued to burgeon as some parts of the stack consolidate and as new challenges arise. Our first attempt to help stakeholders navigate this ecosystem highlighted 25 Hot New Data Tools and W…

怎么连接 mysql_怎样连接连接数据库

这个博客是为了说明怎么连接数据库第一步&#xff1a;肯定是要下载数据库&#xff0c;本人用的SqlServer2008&#xff0c;是从别人的U盘中拷来的。第二步&#xff1a;数据库的登录方式设置为混合登录&#xff0c;步骤如下&#xff1a;1.打开数据库这是数据库界面&#xff0c;要…

webstorm环境安装配置(less+autoprefixer)

node安装&#xff1a; 参考地址&#xff1a;http://www.runoob.com/nodejs/nodejs-install-setup.html 1.下载node安装包并完成安装 2.在开始菜单打开node 3.查看是否安装完成&#xff08;npm是node自带安装的&#xff09; 命令&#xff1a;node -v npm -v less安装&#xff1a…

leetcode 659. 分割数组为连续子序列(贪心算法)

给你一个按升序排序的整数数组 num&#xff08;可能包含重复数字&#xff09;&#xff0c;请你将它们分割成一个或多个子序列&#xff0c;其中每个子序列都由连续整数组成且长度至少为 3 。 如果可以完成上述分割&#xff0c;则返回 true &#xff1b;否则&#xff0c;返回 fa…

将JAVA编译为EXE的几种方法

< DOCTYPE html PUBLIC -WCDTD XHTML StrictEN httpwwwworgTRxhtmlDTDxhtml-strictdtd> 将JAVA编译为EXE的几种方法 -------------------------------------------------------------------------------- 将Java应用程序本地编译为EXE的几种方法(建议使用JOVE和JET)  a.…

文本训练集_训练文本中的不稳定性

文本训练集介绍 (Introduction) In text generation, conventionally, maximum likelihood estimation is used to train a model to generate a text one token at a time. Each generated token will be compared against the ground-truth data. If any token is different …

山东省赛 传递闭包

https://vjudge.net/contest/311348#problem/A 思路&#xff1a;用floyd传递闭包处理点与点之间的关系&#xff0c;之后开数组记录每个数字比它大的个数和小的个数&#xff0c;如果这个个数超过n/2那么它不可能作为中位数&#xff0c;其他的都有可能。 #include<bits/stdc.h…

如何使用动态工具提示构建React Native图表

by Vikrant Negi通过Vikrant Negi 如何使用动态工具提示构建React Native图表 (How to build React Native charts with dynamic tooltips) Creating charts, be it on the web or on mobile apps, has always been an interesting and challenging task especially in React …

如何解决ajax跨域问题(转)

由 于此前很少写前端的代码(哈哈&#xff0c;不合格的程序员啊)&#xff0c;最近项目中用到json作为系统间交互的手段&#xff0c;自然就伴随着众多ajax请求&#xff0c;随之而来的就是要解决 ajax的跨域问题。本篇将讲述一个小白从遇到跨域不知道是跨域问题&#xff0c;到知道…

mysql并发错误_又谈php+mysql并发数据出错问题

最近&#xff0c;项目中的所有crond定时尽量取消&#xff0c;改成触发式。比如每日6点清理数据。原来的逻辑&#xff0c;写一个crond定时搞定现在改为触发式6点之后第一个玩家/用户 进入&#xff0c;才开始清理数据。出现了一个问题1 如何确保第一个玩家触发&#xff1f;updat…

leetcode 621. 任务调度器(贪心算法)

给你一个用字符数组 tasks 表示的 CPU 需要执行的任务列表。其中每个字母表示一种不同种类的任务。任务可以以任意顺序执行&#xff0c;并且每个任务都可以在 1 个单位时间内执行完。在任何一个单位时间&#xff0c;CPU 可以完成一个任务&#xff0c;或者处于待命状态。 然而&…

英国脑科学领域_来自英国A级算法崩溃的数据科学家的4课

英国脑科学领域In the UK, families, educators, and government officials are in an uproar about the effects of a new algorithm for scoring “A-levels,” the advanced level qualifications used to evaluate students’ knowledge of specific subjects in preparati…

MVC发布后项目存在于根目录中的子目录中时的css与js、图片路径问题

加载固定资源js与css <script src"Url.Content("~/Scripts/js/jquery.min.js")" type"text/javascript"></script> <link href"Url.Content("~/Content/css/shop.css")" rel"stylesheet" type&quo…