Front-end-html-table elements

Source: Internet
Author: User

HTML element Classification-table elements

0. <table>: Define the table.

<caption>: Defines the table title. After the caption element follows the table element, each table can define only one title, with the title 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 contents.

<TBODY>: Used to group the main contents of a table.

<TFOOT>: Used to group the contents of a table note (footer) in a table.

<tr>: Defines the rows in the table.

<TH>: Defines a table header cell in a table.

<TD>: Defines a standard cell in a 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. Can only be used in table elements.

<col>: Defines a property value for one or more columns in a table. You can only use the COL element in a 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>

It is important to note that in H5, the col element, the Colgroup element only supports attribute span and must be nested before all child elements within the table element.

Front-end-html-table elements

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.