Question:easy

Anish wants to merge three cells of a single row in an HTML table. Which attribute should he use?

Show Hint

Cells in one row are side by side, so they are in different columns. Which span joins columns?
Updated On: Nov 3, 2026
  • rowspan
  • colspan
  • width
  • align
Show Solution

The Correct Option is B

Solution and Explanation

Step 1: Picture the table:
Draw a row with three boxes next to each other. To merge them into one long box we must join column 1, column 2 and column 3.

Step 2: Pick the direction:
Joining columns is called column spanning. The HTML attribute for it is colspan. Joining rows would be row spanning, which uses rowspan.

Step 3: Remove the others:
width and align change size and position of a cell. They never join cells.

Step 4: Write the code:
<td colspan="3">Merged cell</td> gives one cell covering three columns, so option B is the answer.

Step 5: Why the other three are not the answer:
rowspan stretches a cell downwards over several rows, which is the wrong direction here. width and align change only the size and the position of the content inside a cell, so the three cells would still stay separate.

Final Answer:
Three cells side by side are joined with colspan, so the answer is option B. \[ \boxed{\text{B. colspan}} \]
Was this answer helpful?
0