
- 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 do we display the thickness of the border of an element in HTML?
Use the border attribute in HTML to display the thickness of the border.
Note − This attribute is not supported in HTML5.
Example
You can try to run the following code to learn how to implement border attribute in HTML −
<!DOCTYPE html> <html> <body> <h2>Cricketers</h2> <table style="width:100%" border="1"> <th>Name</th> <tr> <td>Sachin Tendulkar</td> </tr> <tr> <td>Virat Kohli</td> </tr> </table> </body> </html>
Use CSS instead, since the border attribute deprecated in HTML5.
<!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; } </style> </head> <body> <h2>Cricketers</h2> <table style="width:100%"> <caption>Indian Cricketers</caption> <th>Name</th> <tr> <td>Sachin Tendulkar</td> </tr> <tr> <td>Virat Kohli</td> </tr> </table> </body> </html>
- Related Articles
- How do we set the type of element in HTML?
- How do we include the direction of text display in HTML?
- How do we add the maximum number of characters allowed in an element in HTML?
- How to display the background color of an element in HTML?
- How do we display the visible width of a text area in HTML?
- How do we display inserted text in HTML?
- How do we display a script in HTML?
- How do we set the text direction for the content in an element in HTML?
- How do we display a table cell in HTML
- How do we display a text area in HTML?
- How to set style display of an html element in a selenium test?
- How do we include an anchor in HTML?
- How do we create the title of the text track in HTML?
- How do we include an emphasized text in HTML?
- How do we create an image map in HTML?

Advertisements