Skip to content

Commit

Permalink
[vis] render line breaks in TableViz (#2118)
Browse files Browse the repository at this point in the history
* convert line breaks to br tags in table vis

* use css!
  • Loading branch information
Alanna Scott committed Feb 10, 2017
1 parent daa1420 commit 2d910e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions superset/assets/visualizations/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@
table.table thead th.sorting:after, table.table thead th.sorting_asc:after, table.table thead th.sorting_desc:after {
top: 0px;
}

.like-pre {
white-space: pre;
}
3 changes: 3 additions & 0 deletions superset/assets/visualizations/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ function tableVis(slice, payload) {
if (c === 'timestamp') {
val = timestampFormatter(val);
}
if (typeof(val) === 'string') {
val = `<span class="like-pre">${val}</span>`;
}
return {
col: c,
val,
Expand Down

0 comments on commit 2d910e3

Please sign in to comment.