本文介绍了如何在AG网格控件的标题中居中放置文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将文本放在AG网格控件的标题中?我曾尝试在列定义中使用cellstyle和cellclass,但这没有用。谢谢
How can I center the text in the headers for an AG-grid control? I have tried using cellstyle and cellclass in the column definition but that did not work. Thank you
推荐答案我正在使用react,我只是将以下代码段添加到了Table组件的中。 css
I'm using react and I just added the following snippet to my Table component's .css
.ag-header-cell-label { justify-content: center; }我要覆盖 .css $我通过devtools检查发现了 ag-grid 中的c $ c>类,发现它正在使用flexbox进行显示。
I'm overriding the .css class class from ag-grid which I found via devtools inspection, and discovered it's using flexbox for display.
请参阅示例(不做出反应,但概念相同): embed.plnkr.co/O3NI4WgHxkFiJCyacn0r/
See example (not react but same concept): embed.plnkr.co/O3NI4WgHxkFiJCyacn0r/
更多推荐
如何在AG网格控件的标题中居中放置文本?
发布评论