Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cntigers opened this issue Oct 18, 2022 · 7 comments
Closed

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

cntigers opened this issue Oct 18, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@cntigers
Copy link

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 cntigers reopened this Oct 18, 2022
@cntigers
Copy link
Author

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

@draco1023 draco1023 added the enhancement New feature or request label Oct 18, 2022
@draco1023
Copy link
Owner

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

@cntigers
Copy link
Author

啊,我看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>

draco1023 added a commit that referenced this issue Oct 19, 2022
@cntigers
Copy link
Author

cntigers commented Oct 19, 2022

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

@draco1023
Copy link
Owner

draco1023 commented Oct 20, 2022

我用最新的代码试了下,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 added a commit that referenced this issue Oct 28, 2022
draco1023 added a commit that referenced this issue Oct 28, 2022
@draco1023
Copy link
Owner

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

@cntigers
Copy link
Author

666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants