How can we align text to right in ng2-smart-table?
try this code, it works from my side.
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; }
There is another way by using the css only.
To move all columns to the right:
:host /deep/ ng2-smart-table tbody > tr > td{
text-align: right;
}
To move all titles to the right:
:host /deep/ ng2-smart-table thead th{
text-align: center;
}
To move all input filters to the right:
:host /deep/ ng2-smart-table thead input-filter input{
text-align: center;
}
etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With