Table Tag (table) In-depth

Table Tag (table) In-depth
<br />Table is a tag that has been used by everyone for a long time, and it is still in use today. However, due to the current website reconstruction, it is recommended that you do not use tables for layout. Many friends mistakenly believe that using tables is so-called non-standard. In fact, it is not. Table is an important element.
Not long ago, I was looking for the main tags contained in the table. Of course, I wanted to share it with you.
The table tags mainly include table, caption, th, tr, td, thead, tfoot, tbody, col, colgroup . The introduction of each is as follows:
<table>
The table tag defines a table. Inside the <table> tag, you can place table headers, table rows, table columns, table cells, and other table content.
<caption>
The caption element defines a table title. The caption tag must come right after the table tag. You can define only one header per table. Typically this title will be centered above the table.
<th>
Defines the header cells within a table. Text inside this th element is usually rendered in bold.
<tr>
Defines a row in a table.
<td>
Defines a cell in a table.
<thead>
Defines the table header.
The thead, tfoot, and tbody elements give you the ability to group rows in a table. When you create a table, you probably want to have a header row, some rows with data, and a total row at the bottom. This division enables browsers to support scrolling of the table body independently of the table header and footer. When long forms are printed, the table header and footer may be printed on each page that contains the table data.
<tbody>
Defines a table body (text).
Using the <tbody> tag, you can divide a table into a separate section. The <tbody> tag can group one or more rows in a table.
Although you may be tempted to include one, or even two, or more <tbody> tags within a table, we recommend that you have no <tbody> tags within a table.
Within the <tbody> tag, only the <tr> tag can define table rows. And once defined, a <tbody> tag is an independent part of the table. For example, you cannot span from one <tbody> to another <tbody>.
The thead, tfoot, and tbody elements give you the ability to group rows in a table. When you create a table, you probably want to have a header row, some rows with data, and a total row at the bottom. This division enables browsers to support scrolling of the table body independently of the table header and footer. When long forms are printed, the table header and footer may be printed on each page that contains the table data.
<tfoot>
Defines the table's footer (footnote).
The thead, tfoot, and tbody elements give you the ability to group rows in a table. When you create a table, you probably want to have a header row, some rows with data, and a total row at the bottom. This division enables browsers to support scrolling of the table body independently of the table header and footer. When long forms are printed, the table header and footer may be printed on each page that contains the table data.
<col>
Defines the value of a property for one or more columns in a table. You can use this attribute only in a table or colgroup.
<colgroup>
Defines grouping of table columns. This element allows you to group columns for formatting purposes. This element is only valid inside a <table> tag.
There are two ways to use the <colgroup> tag: one is to simply define several identical columns, and the other is to group several different columns together.
PS: The above content is all from w3school, because w3school has marked the copyright in the copyright information and reserves all rights. Then I won’t repost or edit it. I’ll just take a paragraph and you can click to directly view the detailed introduction of a tag. See also the introduction to tables.

<<:  How to remotely connect to MySQL database with Navicat Premium

>>:  Deleting two images with the same id in docker

Recommend

Enabling or disabling GTID mode in MySQL online

Table of contents Basic Overview Enable GTID onli...

JavaScript offsetParent case study

1. Definition of offsetParent: offsetParent is th...

Detailed explanation of JavaScript's built-in objects Math and strings

Table of contents Math Objects Common properties ...

How to use tcpdump to capture packets in Linux system

Let me look at the example code first: 1. Common ...

Detailed explanation of CSS BEM writing standards

BEM is a component-based approach to web developm...

Research on Web Page Size

<br />According to statistics, the average s...

MySQL slow log online problems and optimization solutions

MySQL slow log is a type of information that MySQ...

Comprehensive analysis of MySql master-slave replication mechanism

Table of contents Master-slave replication mechan...

DD DT DL tag usage examples

We usually use the <ul><li> tags, but ...

Web page HTML code: production of scrolling text

In this section, the author describes the special...

Use nginx + secondary domain name + https support

Step 1: Add a secondary domain name to the Alibab...

How to implement parent-child component communication with Vue

Table of contents 1. Relationship between parent ...

Detailed explanation of Docker compose orchestration tool

Docker Compose Docker Compose is a tool for defin...

Vue implements multi-grid input box on mobile terminal

Recently, the company has put forward a requireme...