Advertisements
Advertisements
Question
What for are rowspan and colspan attributes used?
Code Writing
Long Answer
Advertisements
Solution
Sometimes, a table cell is bigger than other cells. Its span is spread to more rows or columns. Such cells can be created with rowspan and colspan. For instance, the following code will produce the table shown below in which cells have different span.
<HTML>
<BODY>
<TABLE BORDER>
<TR>
<TD ALIGN=center ROWSPAN=2 COLSPAN=2>A</TD>
<TD>1</TD>
<TD>2</TD>
</TR>
<TR>
<TD>3</TD>
<TD>4</TD>
</TR>
<TR>
<TD ALIGN=center ROWSPAN=2 COLSPAN=2>C</TD>
<TD ALIGN=center ROWSPAN=2 COLSPAN=2>D</TD>
</TR>
<TR>
</TR>
</TABLE>
</BODY>
</HTML>

shaalaa.com
Is there an error in this question or solution?
