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

表格的宽度能不能支持根据内容自动计算? #15

Open
muyudou opened this issue Aug 29, 2023 · 3 comments
Open

表格的宽度能不能支持根据内容自动计算? #15

muyudou opened this issue Aug 29, 2023 · 3 comments

Comments

@muyudou
Copy link

muyudou commented Aug 29, 2023

No description provided.

@PengChen96
Copy link
Owner

你是想根据列表最长的内容然后不换行去设置列宽吗?然后内容很长的话,列宽就会很长这样吗

@muyudou
Copy link
Author

muyudou commented Sep 27, 2023

你是想根据列表最长的内容然后不换行去设置列宽吗?然后内容很长的话,列宽就会很长这样吗

是的,或者可以加个最大宽度,超过这个换行,目前还想限制死的宽度

@PengChen96
Copy link
Owner

嗯,你可以试下通过columns上的width设置宽度,然后设置rowHpx和alignmentWrapText来换行

exportFile({
  columns: columns,
  dataSource: dataSource,
  rowHpx: null,
  bodyCellStyle: {
    alignmentWrapText: true,
  },
});
image

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

No branches or pull requests

2 participants