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

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

      <h1>Employee Details</h1>


Updated on 30-Dec-2021 04:40:22