Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
The main purpose of using tables in HTML is to display data in rows and columns, helping to organize information in a structured way.
The <table> tag is used to define a table in HTML.
The <tr> tag defines a row in an HTML table.
The <th> tag is used for table headings, and by default, it appears bold and centered.
The <td> tag defines a normal cell (data cell) in a table.
You add a title to your table using the <caption> tag.
The <thead> tag is used to group the heading section of a table.
The <tbody> tag is used to group the main body content of the table.
The <tfoot> tag is used to group the footer section of a table, typically used for summary rows.
The border attribute adds borders around the table and its cells.
Cellpadding controls the space between the cell content and the cell border, while cellspacing controls the space between individual table cells.
Colspan merges two or more columns into a single cell horizontally, while rowspan merges two or more rows into a single cell vertically.
<td colspan="2">Merged Cell</td>
By using <th rowspan="2"> or <td rowspan="2"> in the required cell.
Screen readers can interpret table structures, making data accessible for visually impaired users.
The <caption> tag should be used for the table's title.
It merges two table cells horizontally into one cell in the footer row.
<th> is used for headers and appears bold and centered by default, while <td> is used for ordinary data cells.
HTML tables organize and present data neatly in rows and columns, making information clear and easy to understand.