How to align decimal point of price in django template?


I'm trying to display amount of money a user spent in a table.

I want the display amount to look neat, but it looks like below

https://i.stack.imgur.com/kOpQ3.png


I want their dot to be on the black straight line.

Thank you in advance.

Answers 1

  • here is the solution of your answer you can replace the price with your dyanmic price of django here is picture enter image description here

    here is the html

    <div style="display:inline-block">
              <div style="display: flex;justify-content:space-between"><span>$</span><span>18.75</span></div>
              <div style="display: flex;justify-content:space-between"><span>$</span><span>18.75</span></div>
              <div style="display: flex;justify-content:space-between"><span>$</span><span>18.75</span></div>
              <div style="display: flex;justify-content:space-between"><span>$</span><span>.75</span></div>
              <div style="display: flex;justify-content:space-between"><span>$</span><span>784.75</span></div>
          </div>   
    

Related Articles