
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to create table border in HTML?
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>.
Example
You can try to run the following code to create a border in the table in HTML. We’re using <style> tag here:
<!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; } </style> </head> <body> <h1>Employee Details</h1> <table> <tr> <th>Name</th> <td>Amit</td> <td>Sachin</td> </tr> <tr> <th>Age</th> <td>27</td> <td>34</td> </tr> </table> </body> </html>
Output
- Related Articles
- How to create a collapsed border in HTML?
- How to add space around table border in HTML?
- How to create table header in HTML?
- How to create table footer in HTML?
- How to create table heading in HTML?
- In HTML how to create table header?
- How to create table rows & columns in HTML?
- Create a table in HTML
- How to create Border Images in CSS
- How to Create a Pricing Table using HTML and CSS?
- Create caption for a table in HTML?
- How to create a Border, Border radius, and shadow to a UIView in iPhone/iOS?
- How to create a border pane using JavaFX?
- How to create titled border for a Panel in Java?
- How to create Titled Border for a component in Java?

Advertisements