poi-tl-ext icon indicating copy to clipboard operation
poi-tl-ext copied to clipboard

大佬,会考虑支持colgroup和figure标签么

Open cntigers opened this issue 2 years ago • 5 comments

Describe the bug 大佬,会考虑支持colgroup和figure标签么 HTML content:

Expected behavior A clear and concise description of what you expected to happen.

Screenshots

poi-tl-ext version: 0.3.22

poi-tl version: 1.11.1

Additional context Add any other context about the problem here.

cntigers avatar Oct 18 '22 01:10 cntigers

对于colgroup标签,我考虑的能不能还保持现状不单独不解析colgroup和col,但是在处理td的的style时,取td和col的并集样式(td优先级高)

cntigers avatar Oct 18 '22 02:10 cntigers

figure应该不需要处理 colgroup是可以处理的

draco1023 avatar Oct 18 '22 07:10 draco1023

啊,我看colgroup不生效,源码中TableRenderer把colgroup的element给remove处理的 <table style="float:left;width:66.51%;"> <colgroup> <col style="width:57.38%;"> <col style="width:16.97%;"> <col style="width:25.65%;"> </colgroup> <tbody> <tr> <td>1</td> <td>1</td> <td>1</td> </tr> <tr> <td>1</td> <td>1</td> <td>1</td> </tr> <tr> <td>1</td> <td>1</td> <td>1</td> </tr> </tbody> </table>

cntigers avatar Oct 18 '22 08:10 cntigers

我用最新的代码试了下,colgroup标签生效了;但是colgroup中的宽度现在还没有生效,感觉有些特殊场景比如合并单元格之类的宽度不太好计算 @draco1023

cntigers avatar Oct 19 '22 03:10 cntigers

我用最新的代码试了下,colgroup标签生效了;但是colgroup中的宽度现在还没有生效,感觉有些特殊场景比如合并单元格之类的宽度不太好计算 @draco1023

倒不是不好计算的问题,其实目前的计算逻辑已经足够支撑了,只是要提前合并到单元格样式。 另外td th并不一定会按照colspan来合并,在col上定义宽度其实会有问题,其实只需要在每一行的colspan为1的单元格上定义宽度就够了。 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/col#attr-width 中显示width属性已经废弃了,试过在col中使用属性或者样式在浏览器中似乎都没有效果,所以不打算支持。

draco1023 avatar Oct 20 '22 09:10 draco1023

已支持,优先级:th/td style > col style > col width属性

draco1023 avatar Oct 28 '22 11:10 draco1023

666

cntigers avatar Oct 29 '22 07:10 cntigers