Home  >  Article  >  Web Front-end  >  What is the use of html th

What is the use of html th

藏色散人
藏色散人Original
2021-06-11 11:05:054171browse

html th is a tag used to define the header cell in the table. The text inside the th element is usually rendered as centered bold text, while the text inside the td element is usually left-aligned. Normal text.

What is the use of html th

The operating environment of this article: windows7 system, HTML5 version, DELL G3 computer

html What is the use of th?

HTML tag

Define the header cell in the table.

There are two types of cells in HTML forms:

  • Header cell - contains header information (created by the th element)

  • Standard cells - containing data (created by td elements)

Text inside a td element will usually be rendered as centered bold text, while The text is usually left-aligned normal text.

Tip: If you need to span content across multiple rows or columns, use the colspan and rowspan attributes.

Example

Ordinary HTML table, containing two rows and two columns:

<html>
<body>

<table border="1">
  <tr>
    <th>Company</th>
    <th>Address</th>
  </tr>

  <tr>
    <td>Apple, Inc.</td>
    <td>1 Infinite Loop Cupertino, CA 95014</td>
  </tr>
</table>


</body>
</html>

Effect:

What is the use of html th

Recommended learning : "HTML video tutorial"

The above is the detailed content of What is the use of html th. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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