简体   繁体   English

如何在 AG-Grid Header 中适合大文本?

[英]How to fit large text in AG-Grid Header?

I set .ag-header-cell-label.ag-header-cell-text {white-space:break-spaces;important;} in order to see the full text when width is not enough.But when text is very long like below我设置.ag-header-cell-label.ag-header-cell-text {white-space:break-spaces;important;}以便在宽度不够时查看全文。但是当文本很长时以下

headerName: 'Age of Athlete and asdadfsdf fgdsfgdsfg sdfgsdfgsdfg',

在此处输入图像描述

you can see that it doesn't fit.I increased the height of row but nothing changed.How can I fit long text doesnt matter how much long it is?你可以看到它不适合。我增加了行的高度但没有任何改变。我怎样才能适合长文本不管它有多长?

Plunker: https://plnkr.co/edit/UtfwvTOhpRDivBu5 Plunker: https://plnkr.co/edit/UtfwvTOhpRDivBu5

You can add like this headerHeight: 150 inside gridOptions to increase the header height if the header text is too long.如果 header 文本太长,您可以像这样在gridOptions中添加headerHeight: 150以增加 header 高度。 Because adding this line .ag-header-cell-label.ag-header-cell-text {white-space:break-spaces;important;} you will only get the text in multiple lines with the previous height.因为添加这一行.ag-header-cell-label.ag-header-cell-text {white-space:break-spaces;important;}您只会获得具有先前高度的多行文本。 Try it and if it won't work comment here again.试试看,如果它不起作用,请再次在这里评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM