gpt4 book ai didi

javascript - 使用包装标题时在顶部显示标题文本

转载 作者:行者123 更新时间:2023-11-28 05:30:21 25 4
gpt4 key购买 nike

我有一个剑道网格,其中有一些像这样的列:

columns: [
{
title: 'Test',
field: 'SomeField',
width: '200px'
},
{
title: 'Extra long example title',
field: 'SomeOtherField',
width: '100px',
headerAttributes: { style: "white-space: normal" }
},
...
]

我的长标题顺利完成。但是每个不需要换行的较短列标题都显示在标题底部,如下所示:

+------------+------------+
| | Extra long |
| | example |
| Test | title |
+------------+------------+

但是,我希望标题位于标题顶部,如下所示:

+------------+------------+
| Test | Extra long |
| | example |
| | title |
+------------+------------+

我尝试将 headerAttributes: { style: "margin-top: 0"} 添加到第一列,但它没有改变任何内容。我怎样才能实现这个目标?

最佳答案

ArtemKh 的评论解决了我的问题。我只需将 vertical-align: top 添加到我的 headerAttributes 即可在单元格顶部显示标题。

关于javascript - 使用包装标题时在顶部显示标题文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39743176/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com