40 lines
981 B
CSS
40 lines
981 B
CSS
table {
|
|
width: 100%; /*表格宽度*/
|
|
max-width: 65em; /*表格最大宽度,避免表格过宽*/
|
|
border: 1px solid #dedede; /*表格外边框设置*/
|
|
margin: 15px auto; /*外边距*/
|
|
border-collapse: collapse; /*使用单一线条的边框*/
|
|
empty-cells: show; /*单元格无内容依旧绘制边框*/
|
|
}
|
|
table th,
|
|
table td {
|
|
height: 35px; /*统一每一行的默认高度*/
|
|
border: 1px solid #dedede; /*内部边框样式*/
|
|
padding: 0 10px; /*内边距*/
|
|
}
|
|
|
|
table th {
|
|
font-weight: bold; /*加粗*/
|
|
text-align: center !important; /*内容居中,加上 !important 避免被 Markdown 样式覆盖*/
|
|
background: rgba(158,188,226,0.2); /*背景色*/
|
|
}
|
|
|
|
table tbody tr:nth-child(2n) {
|
|
background: rgba(158,188,226,0.12);
|
|
}
|
|
|
|
table tr:hover {
|
|
background: #efefef;
|
|
}
|
|
|
|
table th {
|
|
white-space: nowrap; /*表头内容强制在一行显示*/
|
|
}
|
|
|
|
table td:nth-child(1) {
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.table-area {
|
|
overflow: auto;
|
|
} |