zui
Version:
一个基于 Bootstrap 深度定制开源前端实践方案,帮助你快速构建现代跨屏应用。
175 lines (138 loc) • 3.03 kB
text/less
/// ========================================================================
/// Bootstrap: tables.less
/// https://github.com/twbs/bootstrap/blob/master/less/tables.less
///
/// ZUI: The file has been changed in ZUI. It will not keep update with the
/// Bootsrap version in the future.
/// http://openzui.com
/// ========================================================================
/// Bootrap: Copyright 2011-2016 Twitter, Inc. Licensed under MIT
/// ========================================================================
// Reset
table {
max-width: 100%;
background-color: @table-bg;
font-size: inherit;
}
caption {
padding: @table-cell-padding;
color: @text-muted;
text-align: left;
}
th {
text-align: left;
}
// Base
.table {
width: 100%;
margin-bottom: @line-height-computed;
// Cells
th,
td {
padding: @table-cell-padding;
line-height: @line-height-base;
vertical-align: top;
border-bottom: 1px solid @table-border-color;
.transition(background, @animation-speed-fast, @animation-type);
}
// Bottom align for column headings
> thead > tr > th {
vertical-align: bottom;
border-bottom: 1px solid @table-border-color;
background-color: @table-head-bg;
color: @table-head-color;
font-weight: @table-head-font-weight;
}
// Account for multiple tbody instances
> tbody + tbody {
border-top: 2px solid @table-border-color;
}
}
// Table with fixed layout
.table-fixed {
table-layout: fixed;
th, td {
overflow: hidden;
white-space: nowrap;
}
tfoot > tr > th,
tfoot > tr > td,
.nofixed,
.nofixed {overflow: visible;}
}
// Table without border
.table-borderless {
thead > tr > th,
th,
td {
border: none;
}
}
// Auto width table
.table-auto {
width: auto;
max-width: 100%;
}
// Condensed table w/ half padding
.table-condensed {
th,
td {
padding: @table-condensed-cell-padding;
}
}
// Bordered version
//
// Add borders all around the table and between all the columns.
.table-bordered {
border: 1px solid @table-border-color;
th,
td {
border: 1px solid @table-border-color;
}
}
// Zebra-striping
//
// Default zebra-stripe styles (alternating gray and transparent backgrounds)
.table-striped > tbody > tr:nth-child(odd) {
> td,
> th {
background-color: @table-bg-accent;
}
}
// Hover effect
//
// Placed here since it has to come after the potential zebra striping
.table-hover > tbody > tr:hover {
> td,
> th {
background-color: @table-bg-hover;
}
}
// Table cell sizing
//
// Reset default table behavior
table col[class*="col-"] {
float: none;
display: table-column;
}
table {
td,
th {
&[class*="col-"] {
float: none;
display: table-cell;
}
}
}
// Table backgrounds
//
// Exact selectors below required to override `.table-striped` and prevent
// inheritance to nested tables.
.table tr {
> td.active,
> th.active,
&.active > td,
&.active > th {
background-color: @table-bg-active;
}
}