Add tables and frames MCQs Quiz | Class 10

This quiz covers essential concepts on HTML tables and frames. It’s designed for Class: X, Subject: Computer Applications (Code 165), Unit: Unit 4: Lab Exercises, Topic: Add tables and frames MCQs Quiz | Class 10. Test your understanding of HTML table structure, cell merging, and the use of iframes. After submitting your answers, you can review your performance and download a detailed PDF of your answers.

Understanding HTML Tables and Frames

HTML (HyperText Markup Language) is the standard language for creating web pages. Among its many features, tables and frames are crucial for organizing data and embedding external content, respectively. Mastering these elements is fundamental for any aspiring web developer.

HTML Tables: Structuring Data

HTML tables are used to display data in a structured, tabular format, much like a spreadsheet. They consist of rows and columns that make data easy to read and understand. While modern web design often uses CSS for layout, tables remain essential for displaying actual tabular data.

Key Table Tags:

  • <table>: Defines the start and end of a table.
  • <tr>: Defines a table row.
  • <th>: Defines a table header cell. Typically, content in <th> is bold and centered by default.
  • <td>: Defines a standard table data cell.

Important Table Attributes:

  • border: Specifies the width of the border around the table and its cells (e.g., border="1").
  • cellpadding: Defines the space between the cell content and its border.
  • cellspacing: Defines the space between cells.
  • width and height: Set the dimensions of the table.
  • colspan: Merges two or more columns into a single cell horizontally. (e.g., <td colspan="2">)
  • rowspan: Merges two or more rows into a single cell vertically. (e.g., <td rowspan="3">)

Example Table Structure:


<table border="1">
  <tr>
    <th>Name</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>Alice</td>
    <td>25</td>
  </tr>
  <tr>
    <td>Bob</td>
    <td>30</td>
  </tr>
</table>
      

HTML Frames: Embedding Content with <iframe>

An HTML <iframe> (Inline Frame) is used to embed another HTML document within the current HTML document. This means you can display a web page inside another web page. Iframes are commonly used for embedding videos (like YouTube), maps (like Google Maps), or content from other sources.

Key <iframe> Attributes:

  • src: Specifies the URL of the document to embed. This is the most important attribute.
  • width and height: Set the dimensions of the iframe.
  • frameborder: Specifies whether to display a border around the iframe (1 for yes, 0 for no).
  • scrolling: Controls whether scrollbars are displayed (yes, no, or auto).
  • name: Assigns a name to the iframe, which can be used as the target for a link.

Example <iframe> Usage:


<iframe src="https://www.example.com" width="600" height="400" frameborder="0"></iframe>
      

While powerful, <iframe> usage should be considered carefully due to potential security risks and impact on user experience if not implemented correctly.

Quick Revision Summary:

  • HTML tables organize data in rows and columns using <table>, <tr>, <th>, <td>.
  • colspan merges columns, rowspan merges rows.
  • <iframe> embeds external web content using the src attribute.
  • Common <iframe> attributes include width, height, frameborder, and scrolling.
  • Always be mindful of accessibility and security when using iframes.

Practice Questions (Without Options):

  1. What HTML tag is used to create a data cell that spans across multiple columns?
  2. Describe the difference between cellpadding and cellspacing attributes in a table.
  3. When would you prefer using a <div> element for layout over an HTML <table>?
  4. What are the primary security concerns associated with using <iframe> elements on a webpage?
  5. How can you embed a YouTube video into your webpage using an HTML frame?

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.