ng2-smart-table,对齐文本

时间:2018-04-11 17:16:36

标签: angular ng2-smart-table

我们如何在 ng2-smart-table 中将文本对齐?

2 个答案:

答案 0 :(得分:1)

尝试此代码,它可以在我这边工作。

DateTimeFormatter formatter = new DateTimeFormatterBuilder()
  .appendPattern("dd-MMM-yyyy  HH:mm:ss")
  .appendFraction(ChronoField.NANO_OF_SECOND, 1, 9, true)
  .toFormatter();

CSS

 :host /deep/ .customformat{ text-align: right; } 

答案 1 :(得分:0)

另一种方法是仅使用 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; }

相关问题