Interview Question

What is a table in HTML?

`<table>` should be used for its proper HTML purpose.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

`<table>` is an element that represents data arranged in rows and columns. • Use table headers and a caption when they help users understand the data; do not use tables for page layout. • Browsers apply the native parsing and behavior defined for this element. • Using its native meaning helps assistive technology understand the content when the element has accessibility semantics.

💡 Simple Example

<table><caption>Quiz scores</caption><thead><tr><th scope="col">Name</th><th scope="col">Score</th></tr></thead><tbody><tr><td>Maya</td><td>95</td></tr></tbody></table>

⚡ Quick Revision

`<table>` should be used for its proper HTML purpose.