Welcome to Interactive Programming Forums, where you can ask questions, receive answers from other members of the community, post code snippets and post exercies.

How to create a 5x4 (5 rows, 4 columns) table with one of rows having a column span set to 4 (colspan="4")?

+3 votes
<html>
<head>
<title></title>
</head>
<body>
<table border="1">
<tr>
<td rowspan="2">row span(1x1, 2x1)</td>
<td rowspan="2">row span(2x1, 3x1)</td>
<td rowspan="2">row span(3x1, 4x1)</td>
<td rowspan="2">row span(4x1, 5x1)</td>
<td rowspan="2">row span(5x1, 6x1)</td>
</tr>
<tr>
<td colspan="4">column span(1x1, 2x1)</td>
</tr>
<tr>
<td colspan="4">column span(2x1, 3x1)</td>
</tr>
<tr>
<td colspan="4">column span(3x1, 4x1)</td>
</tr>
<tr>
<td colspan="4">column span(4x1, 5x1)</td>
</tr>
<table>
</body>
</html>

I also try it upside down, the above. Please help.
posted 12 years ago in HTML by yende (9,130 points)
edited 12 years ago by yende

1 Answer

0 votes
Hello yende,

<html>
<head>
<title></title>
</head>
<body>
<table border="1">
<tr>
<td>&nbsp;Column # 1&nbsp;<br />&nbsp;Row # 1&nbsp;</td>
<td>&nbsp;Column # 2&nbsp;</td>
<td>&nbsp;Column # 3&nbsp;</td>
<td>&nbsp;Column # 4&nbsp;</td>
</tr>
<tr>
<td>&nbsp;Row # 2&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;Row # 3&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;Row # 4&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="4">&nbsp;Row # 5&nbsp;</td>
</tr>
</table>
</body>
</html>
answered 12 years ago by vlad36 (7,400 points)

Related questions

+4 votes
1 answer
+18 votes
1 answer
posted 12 years ago in PHP by Matthew Tembo (6,610 points)
+1 vote
1 answer
posted 12 years ago in SQL by yende (9,130 points)
–2 votes
1 answer
posted 12 years ago in Python by simphiwemakola12 (1,010 points)