Introduction to the table tag in HTML (with code)
不言
Release: 2018-08-02 09:53:12
Original
3297 people have browsed it

This article introduces to you the introduction of the table tag

in HTML (with code). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

Table

Tables are defined by the

tag.

Each table has several rows (defined by

tags), and each row is divided into several cells (defined by .

The code of the above picture is as follows

<body>
        <table width="400" height="400" border="2">
            <!-- 第1行 -->
            <tr>
                <td colspan="4" bgcolor="aqua"></td>
            </tr>
            <!-- 第2行 -->
            <tr>
                <td rowspan="4" bgcolor="antiquewhite"></td>
                <td colspan="3" bgcolor="antiquewhite"></td>
            </tr>
            <!-- 第3行 -->
            <tr>
                <td rowspan="3" bgcolor="aquamarine"></td>
                <td colspan="2" bgcolor="aquamarine"></td>
            </tr>
            <!-- 第4行 -->
            <tr>
                <td rowspan="2" bgcolor="bisque"></td>
                <td bgcolor="bisque"></td>
            </tr>
            <!-- 第5行 -->
            <tr>
                <td></td>
            </tr>
        </table>
    </body>
Copy after login

Recommended related articles:

htmlGiven the label option and add the label (with code)

What is elastic layout? Basic application of flexible layout flex (with code)

The above is the detailed content of Introduction to the table tag

tags).

The letters td refer to table data, that is, the contents of data cells.

Data cells can contain text, pictures, lists, paragraphs, forms, horizontal lines, tables, etc.

For example, draw the following table:

Analysis: 1. Analyze rows, each row is a tr tag

 2. Starting from the first row, see how many cells there are in each row. The cells are the td tags

 3. If the space occupied is 1 row and 1 column, omit the number of rows and directly read < td>

in HTML (with code). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template