I've coded a PrimeFaces (JSF / Java) p:dataTable that uses p:inputNumber for each cell. Everything works, but the table looks ragged due to the left-alignment of p:inputNumber's content. All of the formatting I've tried formats the control itself, not its content.
Is there any way to right-align the content of a p:inputNumber?
If someone in 2020 or later is visiting this page:
For PrimeNG 10 the Angular ngStyle Syntax is needed for input style. Just do the following:
<p-inputNumber [(ngModel)]="0.00" [inputStyle]="{'text-align': 'right'}"></p-inputNumber>
Update 2023:
The above is still a possibility. But when using primeflex I like this solution better, using the already available 'text-right'-class:
<p-inputNumber [(ngModel)]="0.00" inputStyleClass="text-right"></p-inputNumber>
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