Home > Web Front-end > Front-end Q&A > What is the use of html th

What is the use of html th

藏色散人
Release: 2021-06-11 11:05:05
Original
4209 people have browsed it

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>
Copy after login

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!

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