html - 将 CSS 边框分配给谷歌表格行

标签 html css google-visualization

我正在使用 google visualization table 制作一个表格,我尝试让每一行都有一个边框并像这样实现它:

https://jsfiddle.net/5u7ay1jj/4/

但是,border CSS 似乎不起作用。我怎样才能让它工作?而且,默认的 google table css 会突出显示偶数行,而不是奇数行,这是怎么发生的?

最佳答案

表格行没有边框。而是将边框分配给行中的表格单元格。

.rowodd .google-visualization-table-td {
    background-color: Linen;
    border: 4px solid #000000;
}

.rownormal .google-visualization-table-td {
    background-color: #EAF2D3;
    border: 4px solid #000000;
}

https://jsfiddle.net/MrLister/5u7ay1jj/5/

编辑:
重新考虑后,我怀疑你的意思是这样的,只在行周围添加边框,而不是在行中的单元格之间添加边框。

.rowodd .google-visualization-table-td {
    background-color: Linen;
    border: 4px solid #000000;
    border-width: 4px 0 0 0;
}

.rownormal .google-visualization-table-td {
    background-color: #EAF2D3;
    border: 4px solid #000000;
    border-width: 4px 0 0 0;
}
tr:last-child .google-visualization-table-td {
    border-bottom-width:4px;
}
.google-visualization-table-td:first-child {
    border-left-width:4px;
}
.google-visualization-table-td:last-child {
    border-right-width:4px;
}

https://jsfiddle.net/MrLister/5u7ay1jj/6/

关于html - 将 CSS 边框分配给谷歌表格行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33554985/

相关文章:

html - Div 将无法在嵌套网格系统中正确 float

javascript - 谷歌图表 : how do I style one point in a scatter chart?

html - 从 Bootstrap 元素对齐文本字段和文本区域

javascript - 将 base64 格式的图像发送到 Web 服务 - 'application/octet-stream' 不是预期的类型 'text/xml; charset=utf-8'

html - 当内容扩展时,iframe 不会将其下方的 div 向下推

html - 填充未应用于容器元素内的元素?

html - 在 <a> 中移动文本

JavaScript - 防止弹性滚动效果?

javascript - Google 条形图采用全宽

javascript - 如何更改 Google Visualization API GeoChart 中的工具提示字体