html - 为单元格创建具有交替背景颜色的曲线表
问题描述
我想为单元格创建一个具有弯曲边缘、蓝色背景颜色标题和交替背景颜色(灰色和白色)的表格。
这是我想出的 css,它适用于 chrome,但后来我意识到它不适用于 IE 或 firefox。似乎溢出:隐藏在 IE 或 Firefox 中不起作用。
.curvetable tr:nth-child(even) {
background:#e0e0e0;
}
.curvetable th {
border: 1px solid gray;
background-color: SteelBlue;
color: white;
padding: 1em;
}
.curvetable td{
border: 1px solid gray;
padding: .5em 1em;
}
.curvetable th, td{
text-align: left;
margin: .5em 1em;
}
.curvetable {
margin: 1em 0;
width: 100%;
background: #FFF;
color: #024457;
overflow: hidden;
border-radius: 15px;
}
我厌倦了在网上寻找示例,但我找不到任何具有弯曲边缘和交替背景颜色的示例。有人有什么建议吗?谢谢
解决方案
对于曲线:
.curvetable tr:last-child td:first-child {
border-bottom-left-radius: 15px;
}
.curvetable tr:last-child td:last-child {
border-bottom-right-radius: 15px;
}
对于交替的背景颜色:
tr:nth-child(even) {background: #CCC}
tr:nth-child(odd) {background: #FFF}
标题颜色:
#customers th {
background-color: blue;
}
推荐阅读
- javascript - 在本地存储中设置对象的值
- r - 如何重命名每次运行的函数中创建的对象?
- sql-server - 将连接列转换为日期
- java - android中预填充的评分表
- ios - Xcode Simulator 忽略 OS X 键盘布局
- ruby-on-rails - Rails 5路线,网址问题
- r - 使用 R 中的 DBI 和 ActiveDirectoryPassword 身份验证连接到 Azure SQL 数据库
- python - 为包含单词的列表列表生成唯一 ID
- python - 附加到列表的 Python 类对象
- python - 如何对作为矩阵行给出的特定索引集的平均值计算进行矢量化?