Hello! For example I have collection of blocks
Input:
[ [name: "Block #1", x:0, y:0, width:4, height:1], [name: "Block #2", x:0, y:1, width:2, height:1], [name: "Block #3", x:2, y:2, width:2, height:1] ]
Output:
<table width="4" border="1">
<tr>
<td colspan="2" width="4" height="1">Block #1</td>
</tr>
<tr>
<td width="2" height="1">Block #2</td>
<td width="2" height="1">Block #3</td>
</tr>
</table>
Any ideas for algorithm? Blocks not crossing.