mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Table panel: add option for preserving text formatting (#8708)
* table_panel: add option for preserving text formatting * table_panel: fix undefined style error * table_panel: fix class adding (add space before 'class') * table_panel: aligin Type options labels
This commit is contained in:
committed by
Daniel Lee
parent
10127e8ac9
commit
1deeef9e91
@@ -130,6 +130,7 @@ export class TableRenderer {
|
||||
renderCell(columnIndex, value, addWidthHack = false) {
|
||||
value = this.formatColumnValue(columnIndex, value);
|
||||
var style = '';
|
||||
var cellClass = '';
|
||||
if (this.colorState.cell) {
|
||||
style = ' style="background-color:' + this.colorState.cell + ';color: white"';
|
||||
this.colorState.cell = null;
|
||||
@@ -153,7 +154,12 @@ export class TableRenderer {
|
||||
this.table.columns[columnIndex].hidden = false;
|
||||
}
|
||||
|
||||
return '<td' + style + '>' + value + widthHack + '</td>';
|
||||
var columnStyle = this.table.columns[columnIndex].style;
|
||||
if (columnStyle && columnStyle.preserveFormat) {
|
||||
cellClass = ' class="table-panel-cell-pre" ';
|
||||
}
|
||||
|
||||
return '<td' + cellClass + style + '>' + value + widthHack + '</td>';
|
||||
}
|
||||
|
||||
render(page) {
|
||||
|
||||
Reference in New Issue
Block a user