xFactorSchool.com(Beta)
How to Do Examples
Python Examples
HTML Examples
Code Examples
C Code Examples
C++ Code Examples
C# Code Examples
Java Code Examples
Python Code Examples
HTML Code Examples
CSS Code Examples
JavaScript Code Examples
Online Editor
C Code Editor
C++ Code Editor
C# Code Editor
Java Code Editor
Python Code Editor
HTML Code Editor
CSS Code Editor
JavaScript Code Editor
Practice how to create a table with border in an HTML page
HTML Online Editor
Run Code
More HTML Sample Codes
<!DOCTYPE html> <html> <head> <title>Table Border in HTML Page</title> <!-- Title of the page--> <style> /* CSS style added to create border for the table */ table { border: 1px solid green; /* border for the table */ width: 100%; /* width of the table is 100% */ } th, td { border: 1px solid green; /* Border for th and td */ } </style> </head> <body> <!-- elements of the body will be displayed --> <h1>Example of Table Border in a Webpage</h1> <hr/> <!--<table> is used to create table--> <table> <tr> <!--<tr> is used to create table row--> <th>Name</th> <!--<th> is used to create table header--> <th>Gender</th> <th>Age</th> </tr> <tr> <td>Alice</td> <!--<td> is used to create table data--> <td>Female</td> <td>15</td> </tr> <tr> <td>Peter</td> <td>Male</td> <td>16</td> </tr> </table> <p>CSS style is used to add table border. 'border: 1px solid green;' is added for table, th and td.</p> </body> </html>