![](/img/trans.png)
[英]how to adjust react material ui pagination spacing/width on smaller screens
[英]How to adjust the width of the Material Table?
我正在使用材料表,我想知道是否有任何方法可以調整此表的寬度。 我有一個只有兩列的表格,我無法讓它遍布整個屏幕。 嘗試如下沒有結果。
<div style={{ maxWidth: "100%" }}>
<MaterialTable
title="All zones"
columns={columns}
data={data}
options={options}
/>
</div>
對我來說擴展表格寬度的唯一方法如下。 有什么建議么..! 先謝謝了。。
const columns = [
{
field: "name",
title: "Name",
cellStyle: { width: 600, maxWidth: 600 },
headerStyle: { width: 600, maxWidth: 600 }
},
{
field: "description",
title: "Description",
cellStyle: { width: 1000, maxWidth: 1000 },
headerStyle: { width: 1000, maxWidth: 1000 }
},
];
這就是我調整材料表中列的材料表單元格寬度的方式
const columns = [
{
field: "firstName",
title: "First Name",
width: 300 // 1st way
},
{
field: "lastName",
title: "Last Name",
width: '20%' // 2nd way
},
];
這適用於我的 React 項目。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.