html 表格套表格

A table is a set of rows and columns, which could be created on a webpage in HTML, by <table> tag. The tabular representation of complex data makes it readable.

表格是一组行和列,可以通过<table>标签在HTML网页上创建。 复杂数据的表格表示使其易于阅读。

The <table> tag if followed by another tag <th> which specifies the table heading, the <tr> tag defines the table row and the <td> tag holds the table data.

如果<table>标记后跟另一个标记<th> ,该标记指定表标题,则<tr>标记定义表行,而<td>标记保存表数据。

The below code is a sample code to create a table in HTML.

以下代码是在HTML中创建表的示例代码。

<html>
<body>
<table>
<tr>
<th>Name</th>
<th>Age</th>
<th>City</th>
</tr>
<tr>
<td>Shivang</td>
<td>21</td>
<td>Indore</td>
</tr>
<tr>
<td>Amit</td>
<td>22</td>
<td>Gwalior</td>
</tr>
</table>
</body>
</html>

Output

输出量

Additionally, a table name could be assigned to the table by the <caption> element. The <caption> tag is to be inserted immediately after the <table> tag. Although the use of the caption element is completely optional for the table.

此外,可以通过<caption>元素将表名分配给表。 <caption>标记将立即插入<table>标记之后。 尽管对于表,标题元素的使用完全是可选的。

<html>
<body>
<table border>
<caption>Student Record</caption>
<tr>
<th>Name</th>
<th>Age</th>
<th>City</th>
</tr>
<tr>
<td>Shivang</td>
<td>21</td>
<td>Indore</td>
</tr>
<tr>
<td>Amit</td>
<td>22</td>
<td>Gwalior</td>
</tr>
</table>
</body>
</html>

Output

输出量

The <table> tag has attributes which can alter the table representation. The border of the table, the alignment of the content of data in the table is some of them.

<table>标记具有可以更改表表示形式的属性。 表的边界,表中数据内容的对齐就是其中一些。

<table>标签的共同属性 (Common attributes of <table> tag)

align: The align attribute specifies the alignment of the table. The values which could be given to the align attribute are left, right or center.

align :align属性指定表的对齐方式。 可以给align属性指定的值是left,right或center。

<table align="right">

border: By default, the <table> tag applies no border to the table. Thus the border attribute is used to specify the width of the table border. This width could be given in either pixel or percentage.

border :默认情况下,<table>标记不对表应用边框。 因此,border属性用于指定表格边框的宽度。 该宽度可以像素或百分比形式给出。

<table border="10px">

bordercolor: This attribute is used to provide a color to the border. The name or the hex code of the color is provided to this attribute to apply color to the border.

bordercolor :此属性用于为边框提供颜色。 颜色的名称或十六进制代码提供给此属性,以将颜色应用于边框。

<table bordercolor="#0000ff">

width: The width attribute specifies the table width. The value of this attribute is similar to the border as could be given in pixels or percentage form.

width :width属性指定表格的宽度。 此属性的值类似于边框,可以以像素或百分比形式给出。

<table width="100%">

bgcolor: This attribute is used to apply color to the table. The name of the color or the hex-code is to be mentioned to this property. A hex-code of the color is the color code which is defined by the combination in the RGB system.

bgcolor :此属性用于将颜色应用于表格。 颜色或十六进制代码的名称要在此属性中提及。 颜色的十六进制代码是由RGB系统中的组合定义的颜色代码。

<table bgcolor="#000066">

An example with attributes

具有属性的示例

<html>
<body>
<table border="2px" width="80%" bordercolor="#006969" bgcolor="yellow" align="center">
<caption>Student Record</caption>
<tr>
<th>Name</th>
<th>Age</th>
<th>City</th>
</tr>
<tr>
<td>Shivang</td>
<td>21</td>
<td>Indore</td>
</tr>
<tr>
<td>Amit</td>
<td>22</td>
<td>Gwalior</td>
</tr>
</table>
</body>
</html>

Output

输出量

The CSS files also could be used for styling the table and adding more design and layouts to the table and providing the responsiveness to the table simultaneously.

CSS文件还可以用于对表格进行样式设置,为表格添加更多设计和布局以及同时提供对表格的响应能力。

Some commonly used CSS properties of a table are,

表格的一些常用CSS属性是,

  • border

    边境

  • border-collapse

    边界崩溃

  • padding

    填充

  • text-align

    文字对齐

Example of table with CSS

带有CSS的表格示例

<html>
<body>
<style>
table {border: solid 2px black;
border-collapse: collapse;
padding: 10px;
text-align : center;
}
</style>
<table width="80%" bordercolor="#006969" bgcolor="yellow">
<caption>Student Record</caption>
<tr>
<th>Name</th>
<th>Age</th>
<th>City</th>
</tr>
<tr>
<td>Shivang</td>
<td>21</td>
<td>Indore</td>
</tr>
<tr>
<td>Amit</td>
<td>22</td>
<td>Gwalior</td>
</tr>
</table>
</body>
</html>

Output

输出量

翻译自: https://www.includehelp.com/html/html-tables.aspx

html 表格套表格

html 表格套表格_HTML表格相关推荐

  1. html表格去除网格线_HTML表格模式:数据网格

    html表格去除网格线 Previously I've shown HTML & CSS patterns for various kinds of tables, including des ...

  2. 成绩统计自动计算表格_电气计算太慢?62套自动计算EXCEL表格,一键下载秒出结果...

    电气计算太慢?62套自动计算EXCEL表格,一键下载秒出结果 随着社会的整体发展节奏加快,人们的生活和工作节奏也随之加快!尤其是在职场上,高效工作是每个职场人员必须不断锻炼并掌握的专业技能.作为电气工 ...

  3. wpf datagrid 表格内容自动计算_施工测绘20套测量自动计算表格,无脑输入数据出结果...

    施工测绘20套测量自动计算表格,无脑输入数据出结果 施工测量是直接为工程施工服务的,它既是施工的先导,又贯穿于整个施工过程.从场地平整.建(构)筑物定位.基础施工,到墙体施工.建(构)筑物构件安装等工 ...

  4. javascript表格可以输入数据_最火8套测量自动计算表格,输入数据直接得结果,效率提升80%...

    建筑工程项目施工过程中,测量工作很重要,经过标准的测量工作计算出相关数据,施工工作才能更好地进行.完成测量工作后难免要面对大量的测量数据,计算时就比较头疼. 那面对大量的测量数据该怎么办呢?如何才能提 ...

  5. excel计算式自动计算_想要高效工作?62套自动计算EXCEL表格,结果准确速度快!...

    想要高效工作?62套自动计算EXCEL表格,结果准确速度快! 随着社会的整体发展节奏加快,人们的生活和工作节奏也随之加快!尤其是在职场上,高效工作是每个职场人员必须不断锻炼并掌握的专业技能.作为电气工 ...

  6. excel乘法公式怎么输入_电气计算太慢?62套自动计算EXCEL表格,一键下载秒出结果...

    电气计算太慢?62套自动计算EXCEL表格,一键下载秒出结果 随着社会的整体发展节奏加快,人们的生活和工作节奏也随之加快!尤其是在职场上,高效工作是每个职场人员必须不断锻炼并掌握的专业技能.作为电气工 ...

  7. excel 公式 单引号 concat_电气计算速度慢?62套自动计算EXCEL表格,输入数据秒出结果...

    电气计算速度慢?62套自动计算EXCEL表格,输入数据秒出结果 随着社会的整体发展节奏加快,人们的生活和工作节奏也随之加快!尤其是在职场上,高效工作是每个职场人员必须不断锻炼并掌握的专业技能.作为电气 ...

  8. excel计算式自动计算_45套电气自动计算表格+计算软件!EXCEL自动生成版分享

    45套电气自动计算表格+计算软件!EXCEL自动生成版分享! 做电气工程都知道计算表格计算量有多大,不仅计算量大,而且还容易出错!因为计算细节是很多的,一不留神就有可能出错! 最重要的是,数据出错了会 ...

  9. html设置表格边框标签,HTML表格边框的设置小技巧_html

    对于很多初学html的人来说,表格 一般我们用表格的时候总会给它个border属性,比如: ID NAME GENDER 1001 mike male 可以发现表格的边框好像很宽,当然这里的" ...

最新文章

  1. asp.net mvc jqgrid 同一个页面查询不同的表,jqgrid显示不同表的表头和数据并且分页...
  2. Python 3/前端 画图工具:Matplotlib,canvajs,pyecharts
  3. Redis单机版本框架
  4. Vboxmanage改动uuid报错的解决的方法
  5. selenium操作浏览器的前进和后退
  6. 【LeetCode笔记】581. 最短无序连续子数组(Java、数组)
  7. J2EE中EL表达式
  8. Android笔记 fragment入门 静态加载fragment
  9. Python PIL支持的图像文件格式
  10. mysql505复位密码_MySQL数据库复位根用户的密码_MySQL
  11. Ansys Speos | 助力汽车按键开关设计与优化
  12. 如何自学成为设计师_不会自学,你永远只能是个三流设计师
  13. 【基于python的量化策略回测框架搭建】策略表现衡量指标模块
  14. Linux下安装各种常用软件
  15. 苍穹官网HTML源码带音乐
  16. [Android系统原理及开发要点详解
  17. 赴日技术签证全攻略!
  18. 基于Stm32f103利用模拟iic驱动LM75A温度传感器
  19. iview-admin二级目录只有一个时变成一级目录解决方法
  20. 使用canvas进行图片压缩(前端图片压缩核心处理)

热门文章

  1. linux下spi添加设备,Linux Kernl添加spidev的设备节点
  2. mysql加上判断_在mysql中where加if判断
  3. flutter ios打包_Flutter通过BasicMessageChannel与Android iOS 的双向通信
  4. 卸载 流程_一款适合于windows端的卸载神器 彻底清理残留软件
  5. jquery 实现 点击把数据移动右侧 点击再次移回到左侧
  6. 多路复用IO和异步IO
  7. web前端常用知识点
  8. html css3模拟心的跳动
  9. bzoj 2007 [Noi2010]海拔——最小割转最短路
  10. 搭建springboot环境