sx
道具。新的MUI版本还添加了tableCellClasses
对象,以帮助您以类型安全的方式引用组件CSS className,而不是使用硬编码字符串
"MuiTableCell-root"
::
import Table from "@mui/material/Table";
import TableCell, { tableCellClasses } from "@mui/material/TableCell";
<Table
sx={{
[`& .${tableCellClasses.root}`]: {
borderBottom: "none"
}
}}
>
livedemoTableCell
import MuiTableCell from "@material-ui/core/TableCell";
const TableCell = withStyles({
root: {
borderBottom: "none"
}
})(MuiTableCell);
<TableCell sx={{ borderBottom: "none" }}>
{/* ... */}
</TableCell>
要从可以使用的特定表格中卸下边框:
sx={{ "& td": { border: 0 } }}
classes = {{root:class.muitablecell}} tablecell类,然后 MuitableCell:{ BorderBottom:“无” }
我很好地删除了tablecell的边界线线。
卸下表边框线:
.MuiDataGrid-root .MuiDataGrid-cell {border-bottom: none !important;}
对于那些粘在MUI V4的人,这对我有用:
<TableCell style={{ borderBottomWidth: '0px'}}>content</TableCell>
<TableCell style={{ borderBottomWidth: '0px', paddingBottom: 'unset'}}>content</TableCell>