Front-End-HTML-table elements,-HTML-Table Elements

Source: Internet
Author: User

Front-End-HTML-table elements,-HTML-Table Elements

HTML element classification-Table Elements

0. <table>: Define a table.

<Caption>: Define the table title. The caption element follows the table element. Each table can only define one title, and the title is centered on the table.

<table border="1">  <caption>Monthly savings</caption>  <tr>    <th>Month</th>    <th>Savings</th>  </tr>  <tr>    <td>January</td>    <td>$100</td>  </tr></table>

<Thead>: defines the table header. This element is used to combine the table header content.

<Tbody>: used to group the body content in a table.

<Tfoot>: used to group the content of the table note (footer) in the table.

<Tr>: Define rows in the table.

<Th>: defines the header cells in the table.

<Td>: defines the standard cells in the table.

<table border="1">    <thead>        <tr>            <th>Month</th>            <th>Savings</th>        </tr>    </thead>    <tbody>        <tr>            <td>January</td>            <td>$100</td>        </tr>        <tr>            <td>February</td>            <td>$80</td>        </tr>    </tbody>    <tfoot>        <tr>            <td>Sum</td>            <td>$180</td>        </tr>    </tfoot></table>                    

<Colgroup>: combines columns in a table to format them. It can only be used in table elements.

<Col>: defines attribute values for one or more columns in a table. You can only use the col element in the table or colgroup element.

<table border="1">  <colgroup>    <col span="2" style="background-color:red">    <col style="background-color:yellow">  </colgroup>  <tr>    <th>ISBN</th>    <th>Title</th>    <th>Price</th>  </tr>  <tr>    <td>3476896</td>    <td>My first HTML</td>    <td>$53</td>  </tr></table>

Note that in H5, The col and colgroup elements only support the attribute span and must be nested before all the child elements in the table element.

 

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.