HTML Tables: 18 flashcards
All 18 flashcards from this kit, free and with no sign-up.
1. What HTML element is used to create a table?
Show the answer
The `<table>` element.
2. What does the `<tr>` element represent?
Show the answer
A table row.
3. Which elements are used for table headers and table data cells?
Show the answer
`<th>` for header cells and `<td>` for data cells.
4. What is the purpose of the `colspan` attribute?
Show the answer
It makes a cell span across multiple columns.
5. What is the purpose of the `rowspan` attribute?
Show the answer
It makes a cell span across multiple rows.
6. Which attribute is used to provide a short description of a table for screen readers?
Show the answer
The `summary` attribute (though it is deprecated in HTML5, it was used for accessibility).
7. What is the purpose of the `<caption>` element?
Show the answer
It provides a title or description for the table, displayed above the table.
8. What is the difference between `<thead>`, `<tbody>`, and `<tfoot>`?
Show the answer
They group table rows into header, body, and footer sections respectively, providing semantic structure.
9. How do you define a table header cell that spans two columns?
Show the answer
`<th colspan="2">Header</th>`
10. What is the default border of an HTML table?
Show the answer
No border (border is not shown by default).
11. What does the `cellpadding` attribute do?
Show the answer
It specifies the space between the cell content and its border (padding).
12. What does the `cellspacing` attribute do?
Show the answer
It specifies the space between cells.
13. What is the purpose of the `scope` attribute on a `<th>` element?
Show the answer
It specifies whether the header cell is a header for a column, row, or group of columns/rows, improving accessibility.
14. What is the correct HTML structure for a simple table with one row and two columns?
Show the answer
```html <table> <tr> <td>Data 1</td> <td>Data 2</td> </tr> </table> ```
15. What is the purpose of the `align` attribute on a `<td>` element?
Show the answer
It specifies the horizontal alignment of the cell content (e.g., left, center, right).
16. What is the best practice for creating a table that is accessible to screen readers?
Show the answer
Use semantic elements like `<caption>`, `<th>` with `scope`, and `<thead>`, `<tbody>`, `<tfoot>` to provide structure and context.
17. What is the purpose of the `border` attribute on a `<table>`?
Show the answer
It specifies the width of the border around the table and its cells (in pixels).
18. How do you create a table cell that spans two rows and three columns?
Show the answer
`<td rowspan="2" colspan="3">Cell content</td>`
Your notes can be a kit like these
Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free, in 42 languages.
- Chapter notes
- Flashcards
- Practice MCQs
- Scored tests
- Exam prep
Get Veda free See what students get
Free to start · No ads · Works in 42 languages