【发布时间】:2020-03-13 23:17:17
【问题描述】:
我从react-bootstrap 导入了一个Table 组件,并希望在我的项目中使用它。但是,我发现很难覆盖此组件的默认样式。我想出的唯一方法是在每一行的末尾添加!important,但是我认为必须有更好的方法。
这就是我的 Table 组件的样子:
<Table striped bordered hover>
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
</thead>
</Table>
这就是我的 CSS 文件的样子:
th {
text-align: center;
border: none !important;
}
如果没有 !important,它会尝试保持边界(许多情况之一)。
【问题讨论】:
标签: css reactjs react-bootstrap react-bootstrap-table