gpt4 book ai didi

material-ui - 如何增加表格组件的字体大小

转载 作者:行者123 更新时间:2023-12-04 03:27:08 27 4
gpt4 key购买 nike

我开始评价material-ui作为项目的替代方案,我想知道更改表格字体大小的推荐方法是什么。

目前我正在使用组件的沙箱(可在 https://codesandbox.io/s/9onokxxn5w 获得),但我找不到要更改的内容以放大字体大小。

我试图在 demo.js 中更改主题添加 fontSize table 的 key 元素,如下所示,但它不起作用:

const styles = theme => ({
root: {
width: '100%',
marginTop: theme.spacing.unit * 3,
overflowX: 'auto',
},
table: {
minWidth: 700,
fontSize: '40pt'
},
});

在此先感谢您对解决此问题的任何帮助。

最佳答案

似乎它不适用于 Table,但它适用于 TabelRow 或 TableCell。
向 TableRow 元素添加一个类并在其上设置 fontSize 参数

...
<TableRow key={n.id} className={classes.tablecell}>
...

const styles = theme => ({
root: {
width: '100%',
marginTop: theme.spacing.unit * 3,
overflowX: 'auto',
},
table: {
minWidth: 700
},
tablecell: {,
fontSize: '40pt'
}
});

关于material-ui - 如何增加表格组件的字体大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48301906/

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