Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to align text in centre with right justified in CSS?

Tags:

css

alignment

I have to display amount/float values in a table column where the values should be center aligned and right justified using CSS/SCSS.

I tried to use text-align:center; and justify-content:right; but that didn't help me.

Here is the link for reference: [https://finance.yahoo.com/quote/AMZN/history?p=AMZN][1]


1 Answers

I have an example with divs that works for me, maybe you can try this method

<div style="text-align: center;">
    <div style="display: inline-block; text-align: right;">
        Centered<br />
        Content<br />
        That<br />
        Is<br />
        Right<br />
        Aligned
    </div>
</div>
like image 192
Thessa Verbruggen Avatar answered Dec 11 '25 03:12

Thessa Verbruggen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!