Column 1 Column 2 Column 3
Column 1 Column 2 Column 3
Column 1 Column 2 Column 3
Column 1 Column 2 Column 3
English

Consider following code: <html> <head> <title>HTML Table </title> </head> <body> <table border="1"> <tr> <th>Column 1</th> <th>Column 2</th> <th>Column 3</th> </tr> <tr><td rowspan

Advertisements
Advertisements

Question

Consider following code:

<html>
<head>
<title>HTML Table </title>
</head>
<body>
<table border="1">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr><td rowspan="2">AAA X</td><td>AAA Y</td><td>AAA 
Z</td></tr>
<tr><td>BBB Y</td><td>BBB
Z</td></tr>
<tr><td colspan="3">CCC X</td></tr>
</table>
</body>
</html>

From the following four sample tables, identify which one will be created by above code:

(a)

Column 1 Column 2 Column 3
AAA X AAA Y AAA Z
  BBB Y BBB Z
CCC X BBB Y BBB Z

(b)

Column 1 Column 2 Column 3
AAA X AAA Y AAA Z
     
CCC X BBB Y BBB Z

(c)

Column 1 Column 2 Column 3
AAA X AAA Y AAA Z
  BBB Y BBB Z
CCC X    

(d)

Column 1 Column 2 Column 3
AAA X AAA Y AAA Z
  BBB Y BBB Z
CCC X    
Short Answer
Advertisements

Solution

Table (d) will be created by above code.

rowspan="2" makes AAA X span two rows. colspan="3" makes CCC X span all three columns. Therefore, table (d) is the correct output.

shaalaa.com
  Is there an error in this question or solution?
Chapter 4: HTML- II: Images, Links and Tables - Assisted Practice [Page 177]

APPEARS IN

Sumita Arora Computer Applications [English] Class 10
Chapter 4 HTML- II: Images, Links and Tables
Assisted Practice | Q 7. | Page 177