Skip to content

Commit 2d910e3

Browse files
author
Alanna Scott
authoredFeb 10, 2017
[vis] render line breaks in TableViz (#2118)
* convert line breaks to br tags in table vis * use css!
1 parent daa1420 commit 2d910e3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
 

‎superset/assets/visualizations/table.css

+4
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@
2323
table.table thead th.sorting:after, table.table thead th.sorting_asc:after, table.table thead th.sorting_desc:after {
2424
top: 0px;
2525
}
26+
27+
.like-pre {
28+
white-space: pre;
29+
}

‎superset/assets/visualizations/table.js

+3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ function tableVis(slice, payload) {
7272
if (c === 'timestamp') {
7373
val = timestampFormatter(val);
7474
}
75+
if (typeof(val) === 'string') {
76+
val = `<span class="like-pre">${val}</span>`;
77+
}
7578
return {
7679
col: c,
7780
val,

0 commit comments

Comments
 (0)