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

table隐藏滚动条后,表头和内容不对齐 #47777

Closed
Illidan0219 opened this issue Mar 8, 2024 · 2 comments
Closed

table隐藏滚动条后,表头和内容不对齐 #47777

Illidan0219 opened this issue Mar 8, 2024 · 2 comments
Labels

Comments

@Illidan0219
Copy link

Reproduction link

https://github.com/Illidan0219/ant-design-table-issue.git

Steps to reproduce

1、table组件设置了scroll参数,但是在数据不多的时候,也会有滚动条的背景,所以设置ant-table-body的overflow为auto
2、这个时候没有滚动框,但是表头的操作栏和操作栏下面的内容不对齐

What is expected?

可以有属性来设置,当数据的量不足以使表格出现滚动条的时候,可以隐藏滚动条,同时操作栏和下面的内容对齐

What is actually happening?

操作栏和下面的内容不对齐

Environment Info
antd 5.15.1
React 18.2.0
System windows、ios
Browser 122.0.6261.69
@zombieJ
Copy link
Member

zombieJ commented Mar 8, 2024

魔改样式后表头要自行处理,通过 components 自定义 body 部分实现监听是否出现滚动条,然后 components 自定义 header 部分在没有滚动条的时候把滚动条的占位裁剪掉。

@zombieJ zombieJ added Usage and removed unconfirmed labels Mar 8, 2024
Copy link
Contributor

github-actions bot commented Mar 8, 2024

Hello @Illidan0219, we use GitHub issues to trace bugs or discuss plans of Ant Design. So, please don't ask usage questions here. You can try to open a new discussion in antd discussions, select Q&A to ask questions, also can ask questions on Stack Overflow or Segment Fault, then apply tag antd and react to your question.

你好 @Illidan0219,Ant Design Issue 板块是用于 bug 反馈与需求讨论的地方。请勿询问如何使用的问题,你可以试着在 antd discussions 新开一个 discussion,选择 Q&A 类别进行提问,也可以在 Stack Overflow 或者 Segment Fault 中提问(记得添加 antdreact 标签哦~)。

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

No branches or pull requests

2 participants