HTML table

Each table has several rows (defined by the < tr> tag), and each row is divided into several cells (defined by the < td> tag). The letters td refer to table data, the contents of data cells. The < th> tag is used to define the header. Data cells can contain text, pictures, lists, paragraphs, forms, horizontal lines, tables, and more.

Let’s write a simple HTML file to practice these tags:

 表格  

表格

第一行和第一列 第一行和第二列 第一行和第三列
第二行和第一列 第二行和第二列 第二行和第三列

This is the experimental screenshot:

QQ截图20161206113742.png

##border "1" defines the thickness of the outermost border, which is 1. You can also set it to 0, which means no border is displayed (the default is no border). Here we change it to 15 and try:

QQ截图20161206113812.png

Let’s introduce two attributes of the table: colspan: control the number of columns occupied by this unit rowspan: control the number of rows occupied by this unit

 表格  

表格

第一行和第一列
第二行和第一列 第二行和第二列 第二行和第三列
第三行和第一列 第三行和第二列

If you don’t understand it very well, let’s take a look Looking at the performance on the web page, comparison helps us understand. Let the unit in the first column and first row occupy two columns, and let the unit in the second row and first column occupy two rows. This is the effect.

QQ截图20161206114105.png

There are many details that can be defined in the table. We will briefly describe it here. Everyone needs to practice:

Tag: < th>Header< ; /th>: Set the table header

Tag: title< /caption>: Set the table title

Attribute: cellpadding="..."Set the cell edge Distance

Attribute: bgcolor="..."Set the table background color

Attribute: background="..." Use a certain picture as the table background

< table> Define table

Define table title.

Define the header of the table.

Define the rows of the table.

Define table cells.

Define the header of the table.

Defines the body of the table.

Define the footer of the table.

Defines the properties used for table columns.

Defines the group of table columns.


Continuing Learning
||
表格

表格

第一行和第一列
第二行和第一列 第二行和第二列 第二行和第三列
第三行和第一列 第三行和第二列
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!