TABLES AND LINKS IN HTML CLASS VIII

A. Multiple Choice Questions 

  • 1. Which of the following is not an attribute of <a> tag?

    • Answer: c. SRC

    • Explanation: The anchor tag (<a>) uses attributes like href and global attributes like title. The src (or SRC) attribute is used to specify the source file for elements like <img>, <script>, or <iframe>, making it incorrect for the <a> tag.

  • 2. Which attribute specifies the space between the cells?

    • Answer: b. Cell-spacing

    • Explanation: In HTML tables, the cellspacing attribute defines the space between adjacent cells, while attributes like rowspan and colspan manage cell merging, and padding manages the space inside a cell.

      • 3. Which of the following can be used as a hyperlink?

        • Answer: d. All of the options

        • Explanation: Text, images, and buttons can all be turned into or used as hyperlinks in HTML.

      • 4. Which attribute of table allows you to provide the table heading?

        • Answer: c. <Caption>

        • Explanation: The <caption> tag is used to add a title or heading to a table.

      • 5. Which property of a table allows you to maintain a single border for the entire table?

        • Answer: b. Collapse

        • Explanation: The border-collapse: collapse; CSS property collapses cell borders into a single border.

      B. Fill in the blanks

      1. <caption> attribute of <table> specifies the caption for the table. (Note: In HTML, <caption> is technically a tag, but commonly referred to in school curricula for table titles).

      2. href and target (or title) are the attributes of <a> tag.

      3. Hyperlink (or URL) is used to connect webpages on WWW.

      4. valign (Vertical) alignment has three options: top, bottom and middle.

      5. Internal and External are the two types of linking.

      C. State True or False

      1. SRC is the attribute of <a> tag in HTML.

        • Answer: False (SRC is used for <img>, <script>, etc.; <a> uses href).

      2. You can add an image as the background of a table.

        • Answer: True (Can be achieved using CSS background-image).

      3. HTML allows you to specify different colours for both table data and table headings.

        • Answer: True (Styles can be applied independently to <th> and <td> elements).

      4. Padding enables you to specify the space between the border of a cell and its contents.

        • Answer: True (Cell padding controls the internal spacing of a cell).

      5. To define the style for an unvisited link, a:active link is used.

        • Answer: False (An unvisited link uses a:link, whereas a:active is for an active/clicked link).



    • D. Write CSS codes for the following

      • 1. To set the width of a table to 100% and the height to 80px:

        CSS
        table {
        width: 100%;
        height: 80px;
        }
        ```
      • 2. To set the space of 5px between the cell border and cell contents:

        CSS
        td, th {
        padding: 5px;
        }
        ```
      • 3. To set the vertical alignment of the <td> to middle:

        CSS
        td {
        vertical-align: middle;
        }
        ```
      • 4. To set the border thickness to 8px and border colour to red:

        CSS
        table, th, td {
        border: 8px solid red;
        }
        ```
      • 5. To set the colour of the active link to red:

        CSS
        a:active {
        color: red;
        }
        ```

      E. Answer the following questions

      • 1. Define table:

        • A table is a structured arrangement of data organized in rows and columns.

        • In HTML, it is created using the <table> tag to present information clearly.

      • 2. Name the different attributes of <table> tag:

        • Common attributes include border, width, height, cellspacing, cellpadding, and bgcolor.

      • 3. What is the usage of <caption&gt; tag?

        • The <caption> tag is used to specify a title or descriptive heading for a table.

      • 4. What is the significance of <a> tag?

        • The <a> (anchor) tag is essential for creating hyperlinks

        • It allows users to connect and navigate between different webpages or resources on the World Wide Web

      • 5. Name two different types of table alignments:

        • Horizontal alignment (left, center, or right)

        • Vertical alignment (top, middle, or bottom)

      • 6. Write the various attributes of <a> tag:

        • href: Specifies the URL or destination address of the link.

        • target: Specifies where to open the linked document (e.g., _blank opens it in a new window/tab).

        • title: Provides extra advisory information about the link, usually displayed as a tooltip.

        • download: Indicates that the target will be downloaded when the user clicks the hyperlink.

      • 7. What is the difference between border-spacing and border-padding?:

        • border-spacing: Specifies the distance or space between the borders of adjacent cells in a table.

        • padding (commonly referred to in school texts as cell padding): Specifies the space between the border of an individual cell and its inner contents. (Note: Standard CSS uses padding rather than border-padding).

      • 8. What are the different attributes of linking in HTML?:

        • href: Defines the link destination.

        • target: Defines the browsing context/window where the link opens.

        • title: Adds descriptive tooltip text.

        • rel: Defines the relationship between the current document and the linked resource.

      • 9. Write the steps to create a link using an image:

        • Step 1: Open your HTML file and type the opening anchor tag with the href attribute (<a href="url">).

        • Step 2: Immediately inside the anchor tag, place the image tag with its source attribute (<img src="image-name.jpg" alt="Description">).

        • Step 3: Close the anchor tag (</a>).

        • Example: <a href="[https://www.example.com](https://www.example.com)"><img src="logo.png" alt="Website Logo"></a>

      • 10. What is the difference between rowspan and colspan?:

        • rowspan: Allows a table cell to span across multiple rows vertically.

        • colspan: Allows a table cell to span across multiple columns horizontally.

    Comments

    Popular posts from this blog

    TYPES OF HARDWARE CLASS IX

    Computer Applications Class IX Types of Software (Chap 3)

    CLASS X SYLLABUS 2026-27