Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng2-smart-table, align text

How can we align text to right in ng2-smart-table?

like image 673
Sara Zaia Avatar asked Mar 23 '26 09:03

Sara Zaia


2 Answers

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; } 

like image 56
Gelso77 Avatar answered Mar 25 '26 22:03

Gelso77


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.

like image 42
Eli Trab Avatar answered Mar 25 '26 22:03

Eli Trab