what is the use of thead tag in html
This Blog You Will Learn
ஃ what is the use of thead tag in html
ஃ Why use the <thead> tag
ஃ How the <thead> tag works
ஃ Syntax thead tag
ஃ Advantages of using <thead>tag
ஃ Explain Program
ஃ Output
what is the use of thead tag in html
- HTML tables are used to present data in rows and columns .
- <thead> tag is used to define the header section of an HTML table. it groups together row that contain column headings.
- <thead> tag is used to group the header row of table that define column titles.
- <thead> tag is semantic tag.
Why use the <thead> tag
How the <thead> tag works
Advantages of using <thead>tag
- Easy CSS style
- Better table structure
- improved accessibility
- create fixed headers
Syntax thead tag
<table> <thead> <tr> <th>Column 1</th> <th>Column 2</th> </tr> </thead> </table>
what is the use of thead tag in html
Example
what is the use of thead 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> section
head section contains metadata about page. not visible on the page itself.
<title> tag
title section set the title of the page shows the browser tab.
Step 4]
<body><center>
< body> tag contains all the content visible to webpage.
<body> tag contains all the visible content of the page.
inside <body> show the browser screen.
<center> all the content center
Step 5]
<h1> tag heading of page.
<h2> tag subheading of page.
Step 6]
<table>
Step 7]
<thead> tag :- defines the header section of the table.
<tr> tag :- Row the table.
<th> tag :- header cells.
Student Name and Roll No show column headers.
Step 8]
<tbody> tag :- contains the main data of table.
<tr> tag :- row of student data.
<td> tag :- table cell containing student name or roll number.
Step 9]
Closing tag
