gpt4 book ai didi

css - 将样式添加到 AgGrid 中的特定标题单元格

转载 作者:行者123 更新时间:2023-12-04 13:11:51 25 4
gpt4 key购买 nike

我正在处理 AgGrid(AgGridReact 组件),其中一个标题单元格有一个“全选”复选框
Please refer the image here
想知道是否有办法将全选复选框与列中的复选框对齐。

最佳答案

您可以添加 headerClass到特定的列定义并照常应用 css 样式

const columnDefs = [
{
checkboxSelection: true,
headerCheckboxSelection: true,
headerClass: "checkbox",
width: 70
},
{
headerName: "ID",
field: "id",
width: 70
},
...
}
css
/* add role attribute to increase specificity */
.ag-header-cell.checkbox[role="presentation"] {
padding: 20px;
}
现场演示
Edit 64273758/adding-padding-margin-to-a-specific-header-cell-in-ag-grid

关于css - 将样式添加到 AgGrid 中的特定标题单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64273758/

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