Table tag in HTML
- 24-07-2022
- Trung Minh
- 0 Comments
The table tag defines a table in HTML.
In an html table will include the following elements:
- The th tag defines the header of the table.
- The tr tag defines a row in the table.
- The td tag defines a cell in the table.
However, in practice, tables will be much more complicated when they include caption, col, colgroup, thead elements, etc.
So when should you use tables on your website? For example, you need to display a series of products on the page, those products will be displayed with the same structure including: Name, Price, Description .etc. In this case, using a copy to display with each row as a product will help keep your page clutter-free and very legible.
Using
Example : Use a table to display information about HTML tags.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <h1>Học html miễn phí tại web888.vn</h1> <table border="1px"> <tr> <td>Tên Thẻ</td> <td>Mô tả</td> </tr> <tr> <td>a</td> <td>tạo siêu liên kết</td> </tr> <tr> <td>p</td> <td>định nghĩa một đoạn văn bản</td> </tr> <tr> <td>br</td> <td>ngắt dòng hiện tại</td> </tr> </table> </body> </html>