【发布时间】:2019-11-15 22:19:52
【问题描述】:
我正在使用 CSS 网格制作表格。我无法在行中添加边框线。列之间有间隙。应该和图片一样
当我将边框底部添加到单元格时,我得到了什么:
const TableWrapperUI = styled.div`
display: grid;
box-sizing: border-box;
width: 100%;
border: 1px solid #dbeaf4;
grid-template-columns: repeat(
${props => props.columns && props.columns},
fit-content(400px)
);
justify-items: center;
padding: 5px;
justify-content: space-between;
> span {
justify-self: left;
border-bottom: 1px solid red;
}
`;
【问题讨论】:
-
我想不可能对网格的行/列进行样式设置,尽管您可以将跨度包装到例如 div 中并拉伸它们以占据单元格的整个宽度:
> div { width: 100%; display: flex; & > span { justify-content: left; }}跨度> -
@EvgenyTimoshenko 列之间仍有差距
标签: html css reactjs html-table css-grid