Detailed explanation of 2 important tags in html

零下一度
Release: 2017-05-11 15:34:15
Original
1299 people have browsed it

1.

Tags

During the web page creation process, some independent logical parts are divided and placed in a

tag. This

A label acts like a container. A logical section is a set of interrelated elements on a page. For example, an independent column section in a web page is a typical logical part.

## & lt; p ID = "Pigram name" & gt; ... & lt;/p & gt; to make the logic clearer, we can set a name for this independent logic part, use ID#Attribute to provide a unique name for

, just like the ID number uniquely identifies our identity and must be unique.

html基础2 重要标签0

2. table tag Table on the webpage

Four elements to create a table: table, tbody, tr, th, td

a,

: The entire table starts with the tag and ends with the
tag.

b, …: When there is a lot of table content, the table will be downloaded and displayed a little bit, but if the tag is added, the table will have to wait for the table content. It will not be displayed until everything is downloaded. Such as the code in the codeEditor on the right.

c, …: One row of the table, so there are several rows of the table as many pairs of tr.

d, …: A cell of the table. One row contains several pairs of ..., indicating how many columns there are in one row. .

e, …: A cell at the head of the table, table header.

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

<table>
  <tbody>
    <tr>
      <th>班级</th>
      <th>学生数</th>
      <th>平均成绩</th>
    </tr>
    <tr>
      <td>一班</td>
      <td>30</td>
      <td>89</td>
    </tr>
    <tr>
      <td>二班</td>
      <td>35</td>
      <td>85</td>
    </tr>
    <tr>
      <td>三班</td>
      <td>32</td>
      <td>80</td>
    </tr>
  </tbody>
</table>
Copy after login

html基础2 重要标签1

Summary: The table table displays no table lines in the browser before adding css style. The header, that is, the text in th is bold and centered by default.

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

Add a summary to the table

The content of the summary will not be displayed in the browser, and its function is to increase the readability of the table.

Add a title to the table Describe the content of the table and display it above the table

<table>
    <caption>标题文本</caption>
    <tr>
        <td>…</td>
        <td>…</td>
        …
    </tr>
…
</table>
Copy after login

[Related recommendations]

1. Free html online video tutorial

2. html development manual

3. php.cn original html5 video tutorial

The above is the detailed content of Detailed explanation of 2 important tags in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template