GATE / CS ARCHIVE

GATE CSE 2009 / QUESTION 20

HTML row and column spans

Engineering Mathematics & Other Topics · Web Technologies · Full GATE CSE 2009 paper

GATE 2009, Q20 1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Web Technologies

Question 20, GATE 2009: An HTML table has three rows. Row 1 contains ab with rowspan 2 and cd with colspan 2. Row 2 contains ef and gh with rowspan 2. Row 3 contains ik with colspan 2. Count visible cell regions per column and per row: A (2, 2, 3)/(2, 3, 2); B (2, 2, 3)/(2, 2, 3); C (2, 3, 2)/(2, 3, 2); D (2, 3, 2)/(2, 2, 3).
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

The logical 3×3 grid is [ab, cd, cd], [ab, ef, gh], [ik, ik, gh]. Counting distinct vertically separated cells in each column gives 2, 3, 2. Counting distinct horizontally separated cells in each row likewise gives 2, 3, 2. Thus C. These counts refer to the visible cell regions after spans, not the number of underlying grid coordinates.

Expand the spans onto a three-by-three logical grid: row 1 ab, cd, cd; row 2 ab, ef, gh; row 3 ik, ik, gh. In column 1 the first two slots form one ab cell and the last is ik, giving 2 regions. Column 2 has cd, ef, ik, giving 3. Column 3 has cd then a two-row gh, giving 2. The same horizontal counting gives 2, 3, 2 by row. The question counts distinct drawn regions, not the three underlying grid positions in each direction.

Original paper, page 4