3.1 Tables Flashcards
(15 cards)
What does the <table> tag do?
It defines a table for displaying tabular data in rows & columns.
What is the <thead> element used for?
Groups the header row(s) in a table for clarity & semantic structure.
What is the <tbody> element used for?
Groups the main content rows of a table.
What is the <tfoot> element used for?
Groups the footer rows, often used for totals or summary data.
What is the purpose of <tr>?
<tr> defines a table row & contains header (<th>) or data (<td>) cells.
</td></th></tr>
What is the <th> element used for?
Defines a table header cell, typically displayed in bold & centered by default.
What is <td> element used for?
Defines a table data cell containing actual content.
What does the colspan attribute do?
Allows a cell to span multiple columns, e.g, <td colspan="2">.
What does the rowspan attribute do?
Allows a cell to span multiple rows, e.g, <td rowspan="3">.
Can <thead>, <tbody>, & <tfoot> be used without <table>?
No, they must be children of a <table> element.
How do browsers treat table elements visually?
As a grid layout of rows & columns, with implicit styling if no CSS is used.
How can you borders to a table with HTML only?
Use border=”1” inside <table>, though CSS is prefered.
Why is symantic grouping with <thead>, <tbody>, & <tfoot> important?
Enhances accessibility, structure, & style control with CSS/JS.
How do you center text in a table using HTML?
Use align=”center” (deprecated), but CSS (text-align) is recommended.
Can <th> appear in places other than the first row?
Yes, it can be used in any row where a header cell is needed.