Skip to content

Commit a3dec69

Browse files
author
Tina C Lin (RD-TW)
committed
Render an ellipsis ("...") to represent overflowed text.
1 parent 707e221 commit a3dec69

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/Table.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export default class extends Component {
132132
onClick(key, event);
133133
}}
134134
>
135-
{title}
135+
<span className={styles.overflowEllipsis}>{title}</span>
136136
{columnSortStyle &&
137137
<i className={columnSortStyle} />
138138
}

src/table-sortable.styl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
th {
55
white-space: nowrap;
66
}
7+
78
.column-sort {
89
color: #222;
910

@@ -12,6 +13,18 @@
1213
color: #222;
1314
text-decoration: none;
1415
}
16+
17+
> .overflow-ellipsis {
18+
vertical-align: middle;
19+
display: inline-block;
20+
overflow: hidden;
21+
text-overflow: ellipsis;
22+
max-width: calc(100% - 16px); // 16px is icon width
23+
}
24+
25+
> i {
26+
vertical-align: middle;
27+
}
1528
}
1629

1730
.column-sort-asc,

src/table.styl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,8 @@
8282
.table {
8383
table {
8484
.clickable-column {
85-
margin: -8px -12px;
86-
padding: 8px 12px;
8785
color: inherit;
8886
display: block;
89-
padding: 8px 12px;
9087

9188
&:hover {
9289
background-color: #e6e6e6;

0 commit comments

Comments
 (0)