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
Preface Recently, when I was building a project, ...
This article example shares the specific code of ...
Linux basic configuration Compile and install pyt...
This article uses an example to describe how to c...
This article shares the specific code for JavaScr...
Preface Only Innodb and MyISAM storage engines ca...
1. The three files /etc/hosts, /etc/resolv.conf a...
<br />Most of the time when we talk about na...
In the previous article https://www.jb51.net/arti...
Detailed explanation of Java calling ffmpeg to co...
1. Environmental preparation: Operating system: C...
In a recent problem, there is such a phenomenon: ...
Table of contents background question Problem ana...
Table of contents 1. Build Docker 2. Enter the co...
Table of contents 1. Experimental Environment 2. ...