博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
html 表格自定义_如何在HTML中创建和自定义表格
阅读量:2507 次
发布时间:2019-05-11

本文共 4499 字,大约阅读时间需要 14 分钟。

html 表格自定义

This tutorial series will guide you through creating and further customizing using HTML, the standard markup language used to display documents in a web browser. No prior coding experience is necessary but we recommend you start at the if you wish to recreate the demonstration website.

本教程系列将指导您使用HTML(用于在Web浏览器中显示文档的标准标记语言)创建和进一步自定义 。 不需要任何编码经验,但是如果您希望重新创建演示网站,建议您从的 。

At the end of this series, you should have a website ready to deploy to the cloud and a basic familiarity with HTML. Knowing how to write HTML will provide a strong foundation for learning additional front-end web development skills, such as CSS and JavaScript.

在本系列的最后,您应该拥有一个可以部署到云的网站,并且对HTML有了基本的了解。 知道如何编写HTML将为学习其他前端Web开发技能(例如CSS和JavaScript)奠定坚实的基础。

HTML tables are useful for arranging content in rows and columns. This tutorial will teach you how to add a table to your webpage and how customize it by adding a desired amount of rows and columns.

HTML 对于按行和列排列内容很有用。 本教程将教您如何在网页中添加表格以及如何通过添加所需的行数和列数来自定义表格。

A <table> element requires the use of one or more table row <tr> elements, which create table rows, and one or more table data <td> elements, which insert content into table columns. Each of these elements require an opening and closing tag. The table data <td> elements go inside the table row <tr> elements, and the table row <tr> elements go inside the <table> elements. For example, here is a table that has two rows and three columns:

<table>元素需要使用一个或多个创建行的表行<tr>元素,以及一个或多个将内容插入表列的表数据<td>元素。 这些元素中的每一个都需要一个开始和结束标签。 表数据<td>元素位于表行<tr>元素内部,而表行<tr>元素位于<table>元素内部。 例如,这是一个具有两行三列的表:

Column 1 Column 2 Column 3
Column 1 Column 2 Column 3

Clear your index.html file and paste the code snippet above into the document. (If you have not been following the tutorial series, you can review instructions for setting up an index.html file in our tutorial .)

清除index.html文件,然后将上面的代码片段粘贴到文档中。 (如果您还没有遵循该教程系列,则可以在我们的教程“ 查看有关设置index.html文件的说明。)

Save and reload the file in the browser to check your results. (For instructions on loading the file in your browser, please visit of our tutorial on HTML Elements.)

保存并重新加载文件到浏览器中,以检查结果。 (有关在浏览器中加载文件的说明,请访问我们关于HTML Elements的教程的 。)

Your webpage should now have a table with three columns and two rows:

您的网页现在应该有一个包含三列两行的表格:

To add an additional row, add another <tr> element like so:

要添加其他行,请添加另一个<tr>元素,如下所示:

Column 1 Column 2 Column 3
Column 1 Column 2 Column 3
Column 1 Column 2 Column 3

Save your results and check them in your browser. You should receive something like this:

保存结果,然后在浏览器中检查结果。 您应该会收到以下信息:

To add another column, try adding another table data <td> element inside each of the table row <tr> elements like so:

要添加另一列,请尝试在每个表行<tr>元素内添加另一个表数据<td>元素,如下所示:

Column 1 Column 2 Column 3 Column 4
Column 1 Column 2 Column 3 Column 4
Column 1 Column 2 Column 3 Column 4

Save your results and check them in your browser. You should receive something like this:

保存结果,然后在浏览器中检查结果。 您应该会收到以下信息:

Tables can be styled by adding attributes to the <table> element. For example, you can add a border to the table with the border attribute like so:

可以通过将属性添加到<table>元素来设置<table>样式。 例如,您可以使用border属性将border添加到表中,如下所示:

Row 1 Row 2 Row 3
Row 1 Row 2 Row 3

Try adding the border attribute to your table and checking your results in the browser. (You can clear your index.html file and paste in the HTML code snippet above.) Save your file and load it in the browser. You should receive something like this:

尝试将border属性添加到表中,然后在浏览器中检查结果。 (您可以清除index.html文件并粘贴到上面HTML代码段中。)保存文件并将其加载到浏览器中。 您应该会收到以下信息:

You should now understand how to add tables to your webpage and how to customize the amount of rows and columns a table contains. Tables can also be used to arrange content on your web page. There are also many other attributes you can use to style your table. We’ll return to tables as a layout tool and explore their styling possibilities when we begin building our website.

现在,您应该了解如何向您的网页添加表格,以及如何自定义表格包含的行数和列数。 表格也可以用于排列网页上的内容。 您还可以使用许多其他属性来设置表格样式。 我们将开始构建网站时,将表格作为布局工具返回表中,并探讨它们的样式设置可能性。

翻译自:

html 表格自定义

转载地址:http://npegb.baihongyu.com/

你可能感兴趣的文章
Hadoop基础学习:基于Hortonworks HDP
查看>>
为什么linux安装程序 都要放到/usr/local目录下
查看>>
Hive安装前扫盲之Derby和Metastore
查看>>
永久修改PATH环境变量的几种办法
查看>>
大数据学习之HDP SANDBOX开始学习
查看>>
Hive Beeline使用
查看>>
Centos6安装图形界面(hdp不需要,hdp直接从github上下载数据即可)
查看>>
CentOS7 中把yum源更换成163源
查看>>
关于yum Error: Cannot retrieve repository metadata (repomd.xml) for repository:xxxxxx.
查看>>
2020-11-18
查看>>
Docker面试题(二)
查看>>
【NOI 2018】归程(Kruskal重构树)
查看>>
注册用户
查看>>
TZC Intercommunication System
查看>>
HDU 4571 SPFA+DP
查看>>
centos 创建以日期为名的文件夹
查看>>
Java Timer触发定时器
查看>>
Page Object设计模式
查看>>
程序的基础知识
查看>>
在VIM中使用GDB调试 – 使用vimgdb
查看>>