Detailed explanation of HTML tables

Detailed explanation of HTML tables

Function: data display, table application scenario.

<table> table<tr> row<td> cell

Format:

<table>

  <caption>...</caption><!-Table title, centered-->

  <tr>

    <th>...</th>... <!-Table header, content centered, bolded--> 

  </tr>

  <tr>

    <td>...</td>...

  </tr>

</table>

Table structure tag: It is more convenient to load part and display part.

Divide into three parts: header (thead), body (tbody), footer (tfoot) These three tags cannot affect the layout

<table>

  <caption>...</caption>

  <thead>

  <tr>

    <th>...</th>... <!-Table header, content centered, bolded--> 

  </tr>

  </thead>

  <tbody>

  <tr>

    <td>...</td>...

  </tr>

  </tbody>

  <tfoot>

  <tr>

    <td>...</td>...

  </tr>

  </tfoot>

</table> 

table tag attributes

tr tag attributes

<table>


  <tr>

    <td colspan="2"> ...</td>

    <td> ...</td>

  </tr>

  <tr>

    <td>...</td>

    <td>...</td>

    <td>...</td>

  </tr>

</table> 

<table>

  <tr>

    <td> ...</td>

    <td rowspan="2"> ...</td>

  </tr>

  <tr>

    <td>...</td>

    <td>...</td>

    <td>...</td>

  </tr>

</table> 

Description: 1. Complete table structure 2. Put it in the <td> tag

<table>

  <tr>

    <td> ...</td>

    <td> 

       <table>

        <tr>

          <td> ...</td>

          <td>.</td>

        </tr>

      </table>

    </td>

  </tr>

</table>

1. Use table nesting as little as possible.

2. Use tables that span rows and columns as little as possible.

Increase the overall maintenance cost of the code.

When using tables for web page structure layout, borders are generally not set

This is the end of this article about the detailed explanation of HTML tables. For more relevant HTML table content, please search 123WORDPRESS.COM’s previous articles or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

<<:  The difference and introduction of ARGB, RGB and RGBA

>>: 

Recommend

Native JS to achieve drag photo wall

This article shares with you a draggable photo wa...

React's context and props explained

Table of contents 1. context 1. Usage scenarios 2...

Summary of common operation skills of MySQL database

This article summarizes common operating techniqu...

Vue virtual Dom to real Dom conversion

There is another tree structure Javascript object...

Detailed process of decompressing and installing mysql5.7.17 zip

1. Download address https://dev.mysql.com/downloa...

Div nested html without iframe

Recently, when doing homework, I needed to nest a ...

Detailed explanation of Strict mode in JavaScript

Table of contents Introduction Using Strict mode ...

Solutions to MySQL batch insert and unique index problems

MySQL batch insert problem When developing a proj...

Full analysis of web page elements

Relative Length Units em Description: Relative len...

Nginx defines domain name access method

I'm building Nginx recently, but I can't ...

Vue uses custom instructions to add watermarks to the bottom of the page

Project Scenario Add a custom watermark to the en...

Docker installation tomcat dubbo-admin instance skills

1. Download the tomcat image docker pull tomcat:8...

Detailed explanation of HTML form elements (Part 2)

HTML Input Attributes The value attribute The val...

Vue implements file upload and download functions

This article example shares the specific code of ...