提问人:MaS 提问时间:11/14/2023 更新时间:11/14/2023 访问量:26
有没有一种算法可以从矩形集合中构建 html 表格结构?[关闭]
Is there an algorithm to build an html table structure from collection of rectangles? [closed]
问:
闭。这个问题正在寻求有关书籍、工具、软件库等的建议。它不符合 Stack Overflow 准则。它目前不接受答案。
我们不允许提出有关书籍、工具、软件库等建议的问题。您可以编辑问题,以便用事实和引文来回答。
5天前关闭。
我有一个矩形集合,其中每个矩形代表一个表的一个单元格。是否有任何现有的算法(最好是在某些 java 库中)可以将此矩形集合转换为在 td-elements 中设置相应 rowspan 和 colspan 属性的 html 表结构?
例如,以这个矩形集合为例:
-------------------------
| | |
| | R2 |
| | |
| R1 |----------------
| | | |
| | R3 | R4 |
| | | |
-------------------------
| | |
| R5 | R6 |
| | |
-------------------------
所以我们有 6 个矩形(x-左上角,y-左上角,宽度、高度):
Rectangle1(0,0,8,16)
Rectangle2(8,0,16,8)
Rectangle3(8,8,8,8)
Rectangle4(16,8,8,8)
Rectangle5(0,16,16,8)
Rectangle5(16,16,8,8)
因此,我需要的是这样的内容:
<table>
<tr>
<td rowspan="2">R1</td>
<td colspan="2">R2</td>
</tr>
<tr>
<td>R3</td>
<td>R4</td>
</tr>
<tr>
<td colspan="2">R5</td>
<td>R6</td>
</tr>
</table>
我很确定我能够自己实现一些东西。但在可能“重新发明轮子”之前,我只是想确保我需要的东西在某个地方还没有。
答: 暂无答案
评论