Truncate items that don’t fit in the first column

The first column of a table is a heading, and will always be 50% wide.

It makes the table harder to scan when the information in the first
column breaks onto multiple lines, and introduces uneven whitespace in
the table.

This commit adds some CSS to force things in the first column to only
ever be one line. If they are too long to fit, they get truncated with
an ellipsis (`…`)
This commit is contained in:
Chris Hill-Scott
2016-06-09 11:05:54 +01:00
parent 2e8e650733
commit a9f79bcf07
2 changed files with 14 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
.table {
margin-bottom: $gutter;
width: 100%;
table-layout: fixed;
}
.table-heading {
@@ -16,11 +17,14 @@
.table-row {
th {
display: table-cell;
width: 52.5%;
font-weight: normal;
a {
max-height: 1.25em;
.hint {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
@@ -101,6 +105,10 @@
.table-field-heading {
&-first {
width: 52.5%;
}
&:last-child {
padding-right: 0;
}

View File

@@ -58,6 +58,10 @@
&-filename {
@include bold-19;
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&-hint {