HTML tables can be used to display data in rows and columns. Tables are created using the <table> tag, which contains one or more <tr> tags (table rows) and each row contains one or more <td> tags (table data/cells).
Here’s an example of a basic table in HTML:
My HTML Page
Welcome to my HTML page
Row 1, Column 1
Row 1, Column 2
Row 2, Column 1
Row 2, Column 2
In this example, the <table> tag is used to create a table. The table contains two rows, each with two columns. The data in each cell is specified using the <td> tag.
Tables can also be formatted using attributes such as border, cell padding, and cell spacing to control the border, padding, and spacing of the table and its cells. Additionally, tables can be styled using CSS to change the appearance of the table and its contents.
Here’s an example of a table with some formatting applied:
My HTML Page
Welcome to my HTML page
Product Name
Price
Quantity
Product A
$10.00
5
Product B
$15.00
3
In this example, the table is given a border and the cell padding and spacing are specified using CSS. Additionally, the table header is given a background color and bold font weight to make it stand out.
Learners TV is a website that is designed to educate users and provide instructional material on particular subjects and topics.