2011-11-26 06:34:55 +01:00
|
|
|
//
|
|
|
|
// Tables.less
|
|
|
|
// Tables for, you guessed it, tabular data
|
|
|
|
// ----------------------------------------
|
2011-05-04 03:09:25 +02:00
|
|
|
|
2011-06-30 09:15:37 +02:00
|
|
|
|
2012-01-20 22:16:40 +01:00
|
|
|
// BASE TABLES
|
|
|
|
// -----------------
|
|
|
|
|
|
|
|
table {
|
|
|
|
max-width: 100%;
|
|
|
|
border-collapse: collapse;
|
|
|
|
border-spacing: 0;
|
|
|
|
}
|
|
|
|
|
2011-08-17 07:58:01 +02:00
|
|
|
// BASELINE STYLES
|
|
|
|
// ---------------
|
2011-05-04 03:09:25 +02:00
|
|
|
|
2012-01-18 08:39:18 +01:00
|
|
|
.table {
|
2011-05-04 03:09:25 +02:00
|
|
|
width: 100%;
|
2011-11-01 03:37:10 +01:00
|
|
|
margin-bottom: @baseLineHeight;
|
2012-01-18 08:39:18 +01:00
|
|
|
// Cells
|
|
|
|
th,
|
|
|
|
td {
|
|
|
|
padding: 8px;
|
|
|
|
line-height: @baseLineHeight;
|
|
|
|
text-align: left;
|
|
|
|
border-top: 1px solid #ddd;
|
|
|
|
}
|
|
|
|
th {
|
|
|
|
font-weight: bold;
|
|
|
|
vertical-align: bottom;
|
|
|
|
}
|
|
|
|
td {
|
|
|
|
vertical-align: top;
|
|
|
|
}
|
|
|
|
// Remove top border from thead by default
|
|
|
|
thead:first-child tr th,
|
|
|
|
thead:first-child tr td {
|
|
|
|
border-top: 0;
|
|
|
|
}
|
|
|
|
// Account for multiple tbody instances
|
|
|
|
tbody + tbody {
|
|
|
|
border-top: 2px solid #ddd;
|
|
|
|
}
|
2012-01-11 18:43:13 +01:00
|
|
|
}
|
|
|
|
|
2011-11-01 03:37:10 +01:00
|
|
|
|
|
|
|
|
2011-11-30 07:35:03 +01:00
|
|
|
// CONDENSED TABLE W/ HALF PADDING
|
|
|
|
// -------------------------------
|
2011-11-01 03:37:10 +01:00
|
|
|
|
2012-01-15 06:28:47 +01:00
|
|
|
.table-condensed {
|
2011-11-01 03:37:10 +01:00
|
|
|
th,
|
|
|
|
td {
|
2011-11-30 07:35:03 +01:00
|
|
|
padding: 4px 5px;
|
2011-09-08 19:47:05 +02:00
|
|
|
}
|
2011-11-01 03:37:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// BORDERED VERSION
|
|
|
|
// ----------------
|
|
|
|
|
2012-01-15 06:28:47 +01:00
|
|
|
.table-bordered {
|
2011-11-01 03:37:10 +01:00
|
|
|
border: 1px solid #ddd;
|
|
|
|
border-collapse: separate; // Done so we can round those corners!
|
2012-01-26 23:32:11 +01:00
|
|
|
*border-collapse: collapsed; // IE7 can't round corners anyway
|
2011-11-01 03:37:10 +01:00
|
|
|
.border-radius(4px);
|
2011-09-09 08:01:28 +02:00
|
|
|
th + th,
|
2011-11-01 03:37:10 +01:00
|
|
|
td + td,
|
2011-11-30 07:35:03 +01:00
|
|
|
th + td,
|
|
|
|
td + th {
|
2011-09-09 08:01:28 +02:00
|
|
|
border-left: 1px solid #ddd;
|
|
|
|
}
|
2012-01-05 10:34:14 +01:00
|
|
|
// Prevent a double border
|
|
|
|
thead:first-child tr:first-child th,
|
2012-01-15 01:50:36 +01:00
|
|
|
tbody:first-child tr:first-child th,
|
2012-01-05 10:34:14 +01:00
|
|
|
tbody:first-child tr:first-child td {
|
|
|
|
border-top: 0;
|
|
|
|
}
|
2011-11-30 07:35:03 +01:00
|
|
|
// For first th or td in the first row in the first thead or tbody
|
2011-11-01 03:37:10 +01:00
|
|
|
thead:first-child tr:first-child th:first-child,
|
|
|
|
tbody:first-child tr:first-child td:first-child {
|
2011-09-09 08:01:28 +02:00
|
|
|
.border-radius(4px 0 0 0);
|
|
|
|
}
|
2011-11-01 03:37:10 +01:00
|
|
|
thead:first-child tr:first-child th:last-child,
|
|
|
|
tbody:first-child tr:first-child td:last-child {
|
2011-09-09 08:01:28 +02:00
|
|
|
.border-radius(0 4px 0 0);
|
|
|
|
}
|
2011-11-30 07:35:03 +01:00
|
|
|
// For first th or td in the first row in the first thead or tbody
|
|
|
|
thead:last-child tr:last-child th:first-child,
|
|
|
|
tbody:last-child tr:last-child td:first-child {
|
2011-09-09 08:01:28 +02:00
|
|
|
.border-radius(0 0 0 4px);
|
|
|
|
}
|
2011-11-30 07:35:03 +01:00
|
|
|
thead:last-child tr:last-child th:last-child,
|
|
|
|
tbody:last-child tr:last-child td:last-child {
|
2011-09-09 08:01:28 +02:00
|
|
|
.border-radius(0 0 4px 0);
|
|
|
|
}
|
2011-05-04 03:09:25 +02:00
|
|
|
}
|
|
|
|
|
2011-06-30 09:15:37 +02:00
|
|
|
|
2011-11-30 07:35:03 +01:00
|
|
|
// ZEBRA-STRIPING
|
|
|
|
// --------------
|
|
|
|
|
|
|
|
// Default zebra-stripe styles (alternating gray and transparent backgrounds)
|
2012-01-15 06:28:47 +01:00
|
|
|
.table-striped {
|
2011-11-30 07:35:03 +01:00
|
|
|
tbody {
|
|
|
|
tr:nth-child(odd) td,
|
|
|
|
tr:nth-child(odd) th {
|
|
|
|
background-color: #f9f9f9;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-02-05 11:28:42 +01:00
|
|
|
// HOVER EFFECT
|
|
|
|
// ------------
|
|
|
|
// Placed here since it has to come after the potential zebra striping
|
|
|
|
.table {
|
|
|
|
tbody tr:hover td,
|
|
|
|
tbody tr:hover th {
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-30 07:35:03 +01:00
|
|
|
|
2012-01-07 13:34:30 +01:00
|
|
|
// TABLE CELL SIZING
|
|
|
|
// -----------------
|
2011-11-01 03:37:10 +01:00
|
|
|
|
2012-01-07 13:34:30 +01:00
|
|
|
// Change the columns
|
2011-11-01 03:37:10 +01:00
|
|
|
.tableColumns(@columnSpan: 1) {
|
2012-01-07 13:34:30 +01:00
|
|
|
float: none;
|
|
|
|
width: ((@gridColumnWidth) * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1)) - 16;
|
|
|
|
margin-left: 0;
|
2011-11-01 03:37:10 +01:00
|
|
|
}
|
|
|
|
table {
|
|
|
|
.span1 { .tableColumns(1); }
|
|
|
|
.span2 { .tableColumns(2); }
|
|
|
|
.span3 { .tableColumns(3); }
|
|
|
|
.span4 { .tableColumns(4); }
|
|
|
|
.span5 { .tableColumns(5); }
|
|
|
|
.span6 { .tableColumns(6); }
|
|
|
|
.span7 { .tableColumns(7); }
|
|
|
|
.span8 { .tableColumns(8); }
|
|
|
|
.span9 { .tableColumns(9); }
|
|
|
|
.span10 { .tableColumns(10); }
|
|
|
|
.span11 { .tableColumns(11); }
|
|
|
|
.span12 { .tableColumns(12); }
|
|
|
|
}
|