How to create table header in HTML?

HTMLWeb DevelopmentFront End Technology

To create table header in HTML, use the <th>…</th> tag. A table header tag is surrounded by the table row <tr>…</tr>. The <tr> tag is surrounded by the <table> tag. A table consist of a rows and columns, which can be set using one or more <tr>, <th>, and <td> elements. Use the style attribute to add CSS properties for adding a border to the table.

A table row is defined by the <tr> tag. To create table header, use the <th> tag. Just keep in mind that you can only have a single heading in a table.


You can try the following code to create table header in HTML. We’re also using the <style> tag to style the table borders

<!DOCTYPE html>
         table, th, td {
            border: 1px solid black;

            <th>Release Year</th>


Published on 01-Feb-2018 06:48:37