javascript - TableRow Material-UI 之间的间距
问题描述
我想在TableRow MaterialUI组件之间添加空间。我怎样才能做到这一点?
<S.MainTable>
<TableBody>
{rows.map(row => {
return (
<S.StyledTableRow key={row.id}>
<TableCell component="th" scope="row">{row.name}</TableCell>
<TableCell numeric>{row.calories}</TableCell>
<TableCell numeric>{row.fat}</TableCell>
<TableCell numeric>{row.carbs}</TableCell>
<TableCell numeric>{row.protein}</TableCell>
</S.StyledTableRow>
);
})}
</TableBody>
</S.MainTable>
解决方案
将这几行代码添加到表格的 CSS 中:
{
border-spacing: 0 5px !important;
border-collapse: separate !important;
}
推荐阅读
- azure - 如何在 Visual Studio 2019 窗口中创建的 Mac 上的 Visual Studio Code 中本地运行多个 C# Az 函数应用程序?
- java - spring-boot EntityListener,应用上下文中一些bean的依赖形成一个循环
- java - Spring Boot 在控制器 api 上出现 404 错误
- mysql - MariaDB:group by 不计算条目
- kdb - kdb:在变量列表上调用 parse
- python - 我的用户个人资料名称中有一个&符号,它不会让我运行我正在编写的代码。如何删除&符号?
- javascript - 如何在本机反应中显示来自firebase的图像网址
- c# - UDP C++ 服务器和 C# 客户端未接收
- powerbi - Power BI Measure 显示的是 URL 而不是图像
- haskell - 我怎样才能避免<
> 在哈斯克尔?