Basic syntax of the table <table>...</table> - defines a table Copy code The code is as follows:<table border> <tr><th>Food</th><th>Drink</th><th>Sweet</th> <tr><td>A</td><td>B</td><td>C</td> </table>
Copy code The code is as follows:<table> <tr><th>Food</th><th>Drink</th><th>Sweet</th> <tr><td>A</td><td>B</td><td>C</td> </table>
Table Span Table elements spanning multiple columns <th colspan=#> Copy code The code is as follows:<table border> <tr><th colspan=3> Morning Menu</th> <tr><th>Food</th> <th>Drink</th> <th>Sweet</th> <tr><td>A</td><td>B</td><td>C</td> </table>
Table elements spanning multiple rows <th rowspan=#> Copy code The code is as follows:<table border> <tr><th rowspan=3> Morning Menu</th> <th>Food</th> <td>A</td></tr> <tr><th>Drink</th> <td>B</td></tr> <tr><th>Sweet</th> <td>C</td></tr> </table>
Table size settings <table border=#> Border size settings: Copy code The code is as follows:<table border=10> <tr><th>Food</th><th>Drink</th><th>Sweet</th> <tr><td>A</td><td>B</td><td>C</td> </table>
<table border width=# height=#> Table size settings: Copy code The code is as follows:<table border width=170 height=100> <tr><th>Food</th><th>Drink</th><th>Sweet</th> <tr><td>A</td><td>B</td><td>C</td> </table>
<table border cellspacing=#> Table element gap setting: Copy code The code is as follows:<table border cellspacing=10> <tr><th>Food</th><th>Drink</th><th>Sweet</th> <tr><td>A</td><td>B</td><td>C</td> </table>
<table border cellpadding=#> Table internal blank settings: Copy code The code is as follows:<table border cellpadding=10> <tr><th>Food</th><th>Drink</th><th>Sweet</th> <tr><td>A</td><td>B</td><td>C</td> </table>
Alignment/layout of text within a table <tr align=#> <th align=#> #=left, center, right <td align=#> Copy code The code is as follows:<table border width=160> <tr> <th>Food</th><th>Drink</th><th>Sweet</th> <tr> <td align=left>A</td> <td align=center>B</td> <td align=right>C</td> </table>
<tr valign=#> <th valign=#> #=top, middle, bottom, baseline <td valign=#> Copy code The code is as follows:<table border height=100> <tr> <th>Food</th><th>Drink</th> <th>Sweet</th><th>Other</th> <tr> <td valign=top>A</td> <td valign=middle>B</td> <td valign=bottom>C</td> <td valign=baseline>D</td> </table>
Alignment/layout of tables on the page (Floating Table) <table align=left> Copy code The code is as follows:<table align="left" border> <tr><th>Food</th><th>Drink</th><th>Sweet</th> <tr><td>A</td><td>B</td><td>C</td> </table> My favorites...<br> cookies, chocolates, and more.
My favorites... <table align=right>
My favorites... <table vspace=# hspace=#> #=space value Copy code The code is as follows:<table align="left" border vspace=20 hspace=30> <tr><th>Food</th><th>Drink</th><th>Sweet</th> <tr><td>A</td><td>B</td><td>C</td> </table> My favorites...<br> cookies, chocolates, and more.
My favorites... Table title <caption align=#> ... </caption> #=left, center, right Copy code The code is as follows:<table border> <caption align=center>Lunch</caption> <tr><th>Food</th><th>Drink</th><th>Sweet</th> <tr><td>A</td><td>B</td><td>C</td> </table>
<caption valign=#> ... </caption> #=top, bottom valign=top is default. Copy code The code is as follows:<table border> <caption valign=bottom>Lunch</caption> <tr><th>Food</th><th>Drink</th><th>Sweet</th> <tr><td>A</td><td>B</td><td>C</td> </table>
|
<<: Detailed explanation of CSS complex selectors and CSS font styles and color attributes
>>: JavaScript Advanced Programming: Variables and Scope
Table of contents 1. Vue2 syntax 2. Use of Vue3 1...
Running Docker requires root privileges. To solve...
Preview versions of Safari (Technology Preview 10...
Table of contents What is two-way data binding Im...
Table of contents Scope Global Scope Function Sco...
This article introduces the sample code of CSS to...
1.MySQL replication concept It means transferring...
Table of contents 1. Introduction: 2. Prototype c...
Table of contents Inheritance ES5 prototype inher...
Recently, a problem occurred in the project. The ...
Table of contents join algorithm The difference b...
The core is mysqldump and Runtime The operation i...
Table of contents 01 JavaScript (abbreviated as: ...
Table of contents 1. Preface 2. Find two pop-up c...
When starting MongoDB, the prompt is: error while...