How to set horizontal header for a table?

HTMLWeb DevelopmentFront End Technology

Tables in HTML can have horizontal as well as the vertical header. For the horizontal header, you need to set all <th> inside a single <tr> tag i.e. row, that will be the topmost.


You can try to run the following code to set a horizontal header for a table

Live Demo

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

      <h1>Employee Details</h1>
Published on 01-Feb-2018 07:11:02