【问题标题】:How to change the size of material table in react?react如何改变材质表的大小?
【发布时间】:2021-02-11 16:21:57
【问题描述】:

谁能告诉我如何更改使用材料表创建的表的大小? 我正在使用 React,但此代码不起作用。我也尝试过使用“react-virtualized-auto-sizer”,但它不起作用。

options={{
        cellStyle: {
          width: 100,
          maxWidth: 100,
        },
        headerStyle: {
          width: 100,
          maxWidth: 100,
        },
      }}

【问题讨论】:

    标签: javascript css reactjs rxjs material-table


    【解决方案1】:

    使用minWidth 代替maxWidth。有时maxWidth 工作超过 100 个。

    
        options={{
            cellStyle: {
              width: 100,
              minWidth: 100,
            },
            headerStyle: {
              width: 100,
              minWidth: 100,
            },
          }}
    
    

    【讨论】:

      猜你喜欢
      • 2019-06-28
      • 1970-01-01
      • 2021-05-23
      • 1970-01-01
      • 2018-12-03
      • 1970-01-01
      • 2019-09-11
      • 2019-04-11
      相关资源
      最近更新 更多