Tables: <th> MCQs Quiz | Class 10

This quiz covers essential Multiple Choice Questions on HTML Tables, specifically focusing on the <th> (table header cell) tag. Designed for Class X, Subject: Computer Applications (Code 165), Unit 2: HTML. Test your knowledge on how to define table headers, their attributes, and their role in structuring data effectively. Complete the quiz and download your answer PDF to review your understanding.

Understanding <th> in HTML Tables

The <th> tag, short for “table header,” plays a crucial role in structuring HTML tables by defining header cells. Unlike regular data cells (<td>), header cells provide context and meaning to the data in a column or row. This semantic distinction is vital for both human readability and machine accessibility, especially for screen readers.

Key Aspects of <th>

  • Semantic Purpose: The primary function of <th> is to semantically identify cells that represent headers for a group of cells, either a row or a column. This provides a structural context for the data.
  • Default Styling: Browsers typically render the content within <th> tags as bold and horizontally centered, distinguishing them visually from regular data cells.
  • Accessibility: Using <th> correctly is crucial for web accessibility. Screen readers rely on these tags to understand the relationship between header and data cells, making tables navigable for users with visual impairments. The scope attribute can further enhance this by explicitly defining whether a header applies to a ‘row’ or a ‘col’.
  • Placement: <th> tags must always be placed inside a <tr> (table row) tag. They are commonly found in the first row of a table (acting as column headers) or the first column of each row (acting as row headers).
  • Attributes:
    • scope="col": Indicates that the cell is a header for a column.
    • scope="row": Indicates that the cell is a header for a row.
    • colspan: Specifies the number of columns a header cell should span.
    • rowspan: Specifies the number of rows a header cell should span.

Example Table with <th>

Subject Marks Grade
Maths 95 A1
Science 88 A2
English 92 A1

Quick Revision of <th>

  • <th> defines a header cell in an HTML table.
  • It provides semantic meaning and aids accessibility.
  • Content is usually bold and centered by default.
  • Must be placed inside a <tr> tag.
  • Can use scope, colspan, and rowspan attributes.
  • Essential for well-structured and accessible tables.

Extra Practice Questions

  1. What is the main semantic difference between <th> and <td>?
  2. Which HTML tag is used to define a row in an HTML table, and within which <th> must be placed?
  3. How does a browser typically display the text inside a <th> tag differently from a <td> tag?
  4. What is the purpose of the scope="col" attribute when used with <th>?
  5. If you want a table header cell to span across two columns, which attribute would you use?

Author

  • CBSE Quiz Editorial Team

    Content created and reviewed by the CBSE Quiz Editorial Team based on the latest NCERT textbooks and CBSE syllabus. Our goal is to help students practice concepts clearly, confidently, and exam-ready through well-structured MCQs and revision content.