Html basic 2 important tags, html basic 2 tags

Source: Internet
Author: User

Html basic 2 important tags, html basic 2 tags

1. <div> label <div>... </Div> after the webpage creation process, some independent logic parts are divided into one<div>In the tag, the <div> tag serves as a container. The logical part is a group of interrelated elements on the page. For example, an independent topic section in a webpage is a typical logical part.

<Div id = "Forum name">... </div> to make the logic clearer, we can set a name for this independent logic partidAttribute<div>Provide a unique name, just as the ID card number uniquely identifies and must be unique.

2. table labels

Four elements for creating a table: table, tbody, tr, th, and td

A. <table>... </Table>: the entire table<table>Mark start,</table>Mark end.

B. <tbody>... </Tbody>: when the table contains a large amount of content, the table will be downloaded and displayed a little bit. However, if the <tbody> label is added, the table will be displayed only after all the table content is downloaded. For example, the code in the code editor on the right.

C. <tr>... </Tr>: one row of the table. Therefore, there are several rows in the pair of tr tables.

D. <td>... </Td>: A table cell. A row contains several pairs.<td>...</td>Which indicates that a row contains several columns.

E. <th>... </Th>: a cell in the table header,Table header.

F. The number of columns in the table depends on the number of data cells in a row.

<Table> <tbody> <tr> <th> class </th> <th> Number of Students </th> <th> average score </th> </tr> <tr> <td> Class 1 </td> <td> 30 </td> <td> 89 </td> </tr> <td> Class 2 </td>/ td> <td> 35 </td> <td> 85 </td> </tr> <td> Class 3 </td> <td> 32 </ td> <td> 80 </td> </tr> </tbody> </table>
View Code

 

Summary: no table lines are displayed in the browser before the css style is added to the table. Header, that is, the text in th is displayed in bold by default.

<style type="text/css">table tr td,th{border:1px solid #000;}</style>

 

Adding a summary to a table <table summary = "table introduction text"> the summary content is not displayed in the browser. It is used to increase the readability of the table.

Add a title description table to the table, which is displayed at the top of the table.

<Table> <caption> title text </caption> <tr> <td>... </Td> <td>... </Td>... </Tr>... </Table>

 

 

 

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.