Proper table formating with <thead> and <tbody> (#21605)
* Proper table formating with <thead> and <tbody> * Edit table headers and fix indentation
This commit is contained in:
committed by
Huyen Nguyen
parent
b92b49efb6
commit
f48810ca93
@ -8,27 +8,59 @@ The `<table>` tag allows you to display a table on your webpage.
|
|||||||
### Example
|
### Example
|
||||||
```html
|
```html
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<thead>
|
||||||
<td>Row 1, Cell 1</td>
|
<tr>
|
||||||
<td>Row 1, Cell 2</td>
|
<th>Full Name</th>
|
||||||
</tr>
|
<th>Job Role</th>
|
||||||
<tr>
|
<th>Location</th>
|
||||||
<td>Row 2, Cell 1</td>
|
</tr>
|
||||||
<td>Row 2, Cell 2</td>
|
</thead>
|
||||||
</tr>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Sherlock Holmes</td>
|
||||||
|
<td>Detective</td>
|
||||||
|
<td>London</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Harry Potter</td>
|
||||||
|
<td>Wizard</td>
|
||||||
|
<td>Godric's Hollow</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Winnie the Pooh</td>
|
||||||
|
<td>Honey Taster</td>
|
||||||
|
<td>Five Hundred Acre Wood</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
```
|
```
|
||||||
This code block would produce the following output:
|
This code block would produce the following output:
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<thead>
|
||||||
<td>Row 1, Cell 1</td>
|
<tr>
|
||||||
<td>Row 1, Cell 2</td>
|
<th>Full Name</th>
|
||||||
</tr>
|
<th>Job Role</th>
|
||||||
<tr>
|
<th>Location</th>
|
||||||
<td>Row 2, Cell 1</td>
|
</tr>
|
||||||
<td>Row 2, Cell 2</td>
|
</thead>
|
||||||
</tr>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Sherlock Holmes</td>
|
||||||
|
<td>Detective</td>
|
||||||
|
<td>London</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Harry Potter</td>
|
||||||
|
<td>Wizard</td>
|
||||||
|
<td>Godric's Hollow</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Winnie the Pooh</td>
|
||||||
|
<td>Honey Taster</td>
|
||||||
|
<td>Five Hundred Acre Wood</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user