HTML table is allowed to manage the layout of a HTML web page. That’s like navigation bar, body content, text and images. In HTML web page table arrange the data and it represents data in row and columns.
Create HTML table using <table> tag. The HTML table tag start with <table> and end with </table>. Create table row use <tr> tag and create data cell use <td> or <th>.
Create HTML Table:
In HTML create a simple HTML table using <table>, <th>, <tr>, <td> tag and give table border using border=”1″. For example:
<!DOCTYPE html> <html> <head> <title>HTML Table:</title> </head> <body> <table border="1"> <tr> <td>Name:</td> <td>Email:</td> <td>Phone:</td> </tr> <tr> <td> Ram </td> <td> Shyam </td> <td> Jadu </td> </tr> </table> </body> </html>
HTML Table Colspan:
The HTML table colspan attribute defines the number of columns, if you want to span/merge two or more columns into a single column of a table or in a single cell. For example:
HTML Table Rowspan:
The HTML table rowspan attribute defines the number of rows, if you want to span/merge two or more rows into a single column of a table or in a single cell. For Example: