ng2-smart-table, 对齐文本
ng2-smart-table, align text
我们如何在 ng2-smart-table 中将文本右对齐?
试试这个代码,它在我身边有效。
this.settings.columns["title"] = { "title": this.settings.columns["title"].title, type:'html',valuePrepareFunction: function(value){
return '<div class="customformat"> ' + value + ' </div>'
}};
CSS
:host /deep/ .customformat{ text-align: right; }
还有另一种方法,只使用 css。
要向右移动所有列:
:host /deep/ ng2-smart-table tbody > tr > td{
text-align: right;
}
将所有标题向右移动:
:host /deep/ ng2-smart-table thead th{
text-align: center;
}
要向右移动所有输入过滤器:
:host /deep/ ng2-smart-table thead input-filter input{
text-align: center;
}
等等
我们如何在 ng2-smart-table 中将文本右对齐?
试试这个代码,它在我身边有效。
this.settings.columns["title"] = { "title": this.settings.columns["title"].title, type:'html',valuePrepareFunction: function(value){
return '<div class="customformat"> ' + value + ' </div>'
}};
CSS
:host /deep/ .customformat{ text-align: right; }
还有另一种方法,只使用 css。
要向右移动所有列:
:host /deep/ ng2-smart-table tbody > tr > td{
text-align: right;
}
将所有标题向右移动:
:host /deep/ ng2-smart-table thead th{
text-align: center;
}
要向右移动所有输入过滤器:
:host /deep/ ng2-smart-table thead input-filter input{
text-align: center;
}
等等