Detailed explanation of table in html
This article mainly introduces the table in HTML. Interested friends can refer to it. I hope it will be helpful to everyone.
Ordinary table, a simple HTML table consists of table element and tr, td and th elements, where tr refers to the table row, td refers to the cell, and th defines the header. Just leave the empty cells unfilled, or use .
<table> <tr> <th>表头</th> <th>表头</th> <th>表头</th> </tr> <tr> <td>单元格1 </td> <td></td> <td>单元格3</td> </tr> </table>
2. A table with borders. The border element represents the border of the table. The default unit is px. Cellspcing represents the spacing between tables. Cellpadding represents the inner margin/padding distance.
<table border="1" cellspacing="10" cellpadding="30"> <tr> <th>表头</th> <th>表头</th> <th>表头</th> </tr> <tr> <td>单元格1</td> <td>单元格2</td> <td>单元格3</td> </tr> </table>
3. Tables with background images or colors. Note: bgcolor represents color, and background cannot directly add color to html. (This sentence is wrong Yes, the method used is wrong. The format of directly using inline style writing is style="background:red" or style="background-color:red"). Adding it to the table means setting the entire table. If it is used separately Settings in tr or td are settings for individual rows or cells.
##
<table border="1"> <tr> <th>表头</th> <th>表头</th> <th>表头</th> </tr> <tr> <td>单元格1</td> <td>单元格2</td> <td>单元格3</td> </tr> </table>
<table border="1"> <caption>跨行</caption> <tr> <th>姓名</th> <td>Bill Gates</td> </tr> <tr> <th rowspan="2">电话</th> <td>555 77 854</td> </tr> <tr> <td>555 77 855</td> </tr> </table>
<table border="1"> <caption>跨列</caption> <tr> <th>姓名</th> <th colspan="2">电话</th> </tr> <tr> <td>Bill Gates</td> <td>555 77 854</td> <td>555 77 855</td> </tr> </table>
<table border="1"> <tr> <td> <p>这是一个段落,hello World!</p> </td> <td> <ul> <li>这是一个列表 <ul> <li>html</li> <li>css</li> <li>javascript</li> </ul> </li> </ul> </td> </tr> </table>
Specifies which part of the outer border is visible. //Will not be used for the time being.
Related recommendations:
Implementation of HTML page table scroll bar
Detailed explanation of ElTableColumn extension method
Related operations of SQL ALTER TABLE statement
The above is the detailed content of Detailed explanation of table in html. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.
