如何在AG网格控件的标题中居中放置文本?

编程入门 行业动态 更新时间:2024-10-28 11:26:27
本文介绍了如何在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 类,发现它正在使用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网格控件的标题中居中放置文本?

本文发布于:2023-10-07 22:22:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1470681.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网格   控件   文本   标题   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!