what is th tag in HTML
This Blog You Will Learn
ஃwhat is <th> tag in HTML
✅ <th> tag stands table header
✅ defines a header cell in HTML table.
✅ <td> ,<th> cells bold and centered by default.
✅ <th> tag is use to define a header cell in HTML table.
✅ <table> - creates the table. defines an HTML table
✅ <tr> - Creates rows .Defines a row in a table
✅ <th> - Creates header cells ina table
✅ <td> - creates data cells
Visual Structure
Why Use <th> ?
✔ Improves table accessibility.
✔ help- screen readers announce table structure.
✔ Distinguishes headers visually (bold/centered)
✔ SEO Improves page structure
✔ table data.
Syntax of HTML <th> tag
<th>
..
.
</th>
what is th tag in HTML
Example
<!DOCTYPE html>
<html>
<head>
<title> html th tag </title>
</head>
<body>
<h2>HTML th Tag </h2>
<table>
<tr>
<th>HTML</th>
<th>PHP</th>
</tr>
<tr>
<th>C</th>
<th>JavaScript</th>
</tr>
</table>
</body>
</html>
what is th tag in HTML
Explain Program
Step 1]
<!DOCTYPE html>
This declare the document type.
browser that the document is written in html
Step 2 ]
<html>.... . </html>
html is the root element of the html page.
Every thing inside it is part of the webpage.
Step 3]
<head>.....</head>
head section contain metadata about the webpage information
for the browser not display on the webpage.
<title> html th tag </title>
sets the title of page appears the browser tab
Step 4]
<body>
<h2>HTML th Tag </h2>
<body> tag contains all the content visible on webpage.
<h2> create heading , display HTML TH TA G
Step 5]
<table>
<tr>
<th>HTML</th>
<th>PHP</th>
</tr>
<tr>
<th>C</th>
<th>JavaScript</th>
</tr>
</table>
- <table> tag creates table to organize data row and columns.
- <tr> tag -> <tr> tag stands for table row
- <th> tag -> <th> tag table header.
Two Row
- First row HTML & PHP Table
- Second row C, Javascript Table
- default text <th> is bold and centered.
Step 6]
Closing tag
</table>
</body>
</html>
