user10384702
user10384702

Reputation:

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

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]

Upvotes: 3

Views: 261

Answers (1)

Thessa Verbruggen
Thessa Verbruggen

Reputation: 321

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>

Upvotes: 1

Related Questions