HTML Learning (vii) Table

Source: Internet
Author: User

Form
the table is defined by the <table> tag . Each table has several rows (defined by the <tr> tag) and each row is split into several cells (defined by the <td> tag). The letter TD refers to the table data, which is the contents of the data cell. Data cells can contain text, pictures, lists, paragraphs, forms, horizontal lines, tables, and so on.

Empty cells in a table
In some browsers, table cells with no content are not displayed well. If a cell is empty (no content), the browser may not be able to display the border of the cell.

<table border= "1" ><tr><td>row 1, cell 1</td><td>row 1, cell 2</td></tr>< Tr><td></td><td>row 2, Cell 2</td></tr></table>

Note: The border of this empty cell is not displayed. To avoid this situation, add a space placeholder to the empty cell to display the border.

<table border= "1" ><tr><td>row 1, cell 1</td><td>row 1, cell 2</td></tr>< Tr><td> </td><td>row 2, cell 2</td></tr></table>

Table Labels

<table> Defining tables
<caption> Defines the table title.
<th> Defines the table header for the table.
<tr> Defines the row for the table.
<td> Defines a table cell.
<thead> Defines the header of the table.
<tbody> Defines the body of the table.
<tfoot> Defines the footer of the table.
<col> Defines the properties used for table columns.

<colgroup> defines a group of table columns.

Example 1. This example shows how to display a table header.

Example 2. This example shows a table with a caption (caption)

Example 3. This example shows how to define table cells that span rows or across columns.

Example 4. This example shows how to display an element within a different element.

Example 5. This example demonstrates how to use cell padding to create a space between the contents of a cell and its border.

Example 6. This example demonstrates how to use cell spacing to increase the distance between cells.

Example 7. This example shows how to add a background to a table.

Example 8. This example shows how to add a background to one or more table cells.

Example 9. This example demonstrates how to use the Align property to arrange the contents of a cell to create an aesthetically pleasing table.

  Example 10. This example demonstrates how to use the Frame property to control the bounding rectangle around a table.

HTML Learning (vii) Table

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.