Sus*_*lke 2 pagination components reactjs material-ui material-table
我想增加材料表页脚分页部分的字体大小。
在下图中,我可以使用以下代码更改每页行的字体大小
[1]:https://i.stack.imgur.com/cjNmp.png
components={{
Pagination: props => (
<TablePagination
{...props}
SelectProps={{
style:{
fontSize: 20
}
}}
/>
)
}}
Run Code Online (Sandbox Code Playgroud)
但仍然无法改变整个下划线部分的增加尺寸
我使用两种不同的方法设置两个标题区域的样式:一种通过工具栏样式,另一种直接:
组件中有两个部分,默认情况下results per page是一个p
import makeStyles from "@material-ui/core/styles/makeStyles";
const useStyles = makeStyles({
caption: {
color: "green",
padding: 8,
border: "1px dashed grey",
fontSize: "0.875rem"
},
toolbar: {
"& > p:nth-of-type(2)": {
fontSize: "1.25rem",
color: "red",
fontWeight: 600
}
}
});
// then later
const classes = useStyles();
<TablePagination
// ...
classes={{
toolbar: classes.toolbar,
caption: classes.caption
}}
/>
Run Code Online (Sandbox Code Playgroud)
这是一个codesandbox演示
| 归档时间: |
|
| 查看次数: |
5522 次 |
| 最近记录: |