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
feat: 💥 support tableLayout and column.ellipsis #17284
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add tests to make sure this change works as expected?
Deploy preview for ant-design ready! Built with commit 4fe4706 |
4fe4706
to
4c3b3ae
Compare
Deploy preview for ant-design ready! Built with commit 0ad9967 |
4c3b3ae
to
ad4247c
Compare
放 4.0 里? |
这个加 3.x 里能解决表格当前很多对齐问题。 |
d5e1fdb
to
d132505
Compare
Codecov Report
@@ Coverage Diff @@
## feature #17284 +/- ##
===========================================
+ Coverage 96.74% 96.78% +0.03%
===========================================
Files 280 280
Lines 7552 7552
Branches 2104 2093 -11
===========================================
+ Hits 7306 7309 +3
+ Misses 244 241 -3
Partials 2 2
Continue to review full report at Codecov.
|
已加 |
用例都挂了,https://github.com/kaimallea/isMobile/ 最近没发版本,见鬼了。 |
原来是我把这个发掉了:react-component/menu@72242cf |
👍 看着 OK 了,CI fix 了就可以合了。 |
@@ -328,6 +333,7 @@ | |||
&-thead > tr > th, | |||
&-tbody > tr > td { | |||
padding: @table-padding-vertical @table-padding-horizontal; | |||
overflow-wrap: break-word; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还需要给设定了宽度的列加上,word-break: break-word
不然还是会有对齐问题。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
来了 #18789
省略能自动加title不呢?不然列表里面看不清到底是啥内容 |
表头能否也加上这个属性呢? |
在上一版本中 我认为 tableLayout='auto' 可以解决,但该属性没有生效。 |
@fengyun2 之前试过不太好加,可以来试试给个 PR |
我加上这个属性之后,表头单元格也省略了,我感觉得表头标题不应该省略,应该加个属性切换 |
antd已经上了这个功能了 |
table中的columns.ellipsis属性与table的scroll属性在火狐上不兼容,出现不对齐且无法实现省略号的问题 |
🤔 This is a ...
🔗 Related issue link
react-component/table#369
close #13825 (comment)
close #17127
close #5753
💡 Background and solution
<Table tableLayout="fixed" />
const columns = [{ title: 'Long Column Long Column Long Column', dataIndex: 'address', key: 'address 2', + ellipsis: true, }]
📝 Changelog
tableLayout
property for table-layout attribute. And usingtableLayout="fixed"
defaully in scrollable table situation to resolve align issue caused by cell content.- Table supports
column.ellipsis
to ellipsize cell content.tableLayout
属性,支持设置表格的 table-layout 布局,并在固定表头/列下默认开启tableLayout="fixed"
,解决因为表格自动根据内容排版造成的列对齐问题。- Table 新增
column.ellipsis
支持单元格内容自动省略。☑️ Self Check before Merge
IssueHunt Summary
Referenced issues
This pull request has been submitted to:
IssueHunt has been backed by the following sponsors. Become a sponsor