How to create table border in HTML?

HTMLWeb DevelopmentFront End Technology

To create table border in HTML, the border attribute was used. But the introduction of HTML5, deprecated the border tag. Create table border using the CSS property border. Set table border as well as border for <th> and <td>.


You can try to run the following code to create a border in the table in HTML. We’re using <style> tag here:

Live Demo

<!DOCTYPE html>
         table, th, td {
            border: 1px solid black;
      <h1>Employee Details</h1>
Published on 23-Apr-2018 10:54:03