Issue
How can I create this table with HTML?

I tried it but not sure how to do it correctly.
My code:
<table border=1 cellpadding=0 cellspacing=0>
<tr>
<td> </td>
<td> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan=2> </td>
<td> </td>
<td> </td>
</tr>
</table>
Solution
Use rowspan and colspan attributes.
The table has 3 columns (cells) and 3 rows:
<table>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2" rowspan="2"> </td>
<td> </td>
</tr>
<tr>
<!-- <td> from prev <tr> here with colspan="2" and rowspan="2" -->
<td> </td>
</tr>
</table>
Make sure that every row (<tr>) has always the same count of cells/columns (<td>).
An <td> with colspan="2" counts as 2.
- So the first
<tr>has 3 cells (1+1+1). - The second has also 3 (2+1) ...
- ... and the last has one
<td>from the previous<tr>which hascolspan="2"androwspan="2"and the last<td>element, so 3 cells (2+1)
Answered By - Daniel Kutik
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.