首页 > 解决方案 > 在单元格中换行

问题描述

我在我的 ReactJS 页面上的 ag-grid 中关注了列定义。

    const myColDefs = [
    {
        headerName: "ProductDescription",
        field: 'Product_Desc'
        width:50
        resizable: true,
        wrapText:true,
        cellStyle: {'white-space':'normal'},
        autoHeight: true
    }
]

如果产品描述太长(比如超过 100 个字),则文本不会被包裹在单元格中。我确实在 cellStyle 中尝试了以下操作,但对我不起作用:'text-overflow':'clip''overflow-wrap':'break-word'

谢谢你。

标签: reactjsag-grid

解决方案


推荐阅读