gpt4 book ai didi

javascript - react 字体大小的 Material 表太小了

转载 作者:行者123 更新时间:2023-12-02 16:48:50 25 4
gpt4 key购买 nike

我是一个使用 React 的新手,我的项目使用了 material-table

然而字体大小对我来说太小了,图片附在下面 enter image description here enter image description here我想增加表格的字体大小。

这是代码

state = {
columns: [
{ title: "ID", field: "id", type: "numeric" },
{ title: "Title", field: "title" },
{ title: "Active", field: "active", type: "boolean" },
{ title: "# Questions", field: "number_of_questions" }
],
data: [
{ id: 1, title: "First Survey", active: true, number_of_questions: 9 },
{ id: 2, title: "Second Survey", active: false, number_of_questions: 8 }
]
};
render() {
return (
<div className="example-box-wrapper">
<div className="adjust example-box-wrapper">
<div id="dynamic-table-example-1_wrapper">
<MaterialTable
title="All Surveys"
columns={this.state.columns}
data={this.state.data}
editable={{
onRowAdd: newData => this.addNew(newData),
onRowUpdate: (newData, oldData) =>
this.update(newData, oldData),
onRowDelete: oldData => this.delete(oldData)
}}
/>
</div>
</div>
</div>
);
}

请帮忙

最佳答案

<MaterialTable
...
options={{
rowStyle: {
fontSize: 24,
}
}}
/>

尝试添加 options 属性。请引用docs额外的样式选项。

关于javascript - react 字体大小的 Material 表太小了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59555946/

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