Struggling with aligning the numbers for money properly? Want them to appear relative to each other but aligned to the left side of the columns, similar to the example in the screenshot below:
Current Alignment:
https://i.sstatic.net/9EnoS.png
Desired Alignment:
https://i.sstatic.net/9CEwP.png
Here is how my structure looks like:
<tr>
<td style="text-align: left">name</td>
<td style="text-align: right">money</td>
<td style="text-align: center">date</td>
</tr>
The only CSS modifications I've made so far is setting the width of each td element to 30%
Initially, I tried using a <p>
tag inside each cell to align the content to the right and distribute the rest proportionally, but it resulted in adding unnecessary JS or jQuery. Bootstrap is available as well, but I have not utilized it much beyond basic column grid positioning.
If anyone has suggestions on achieving the desired alignment, or can provide some guidance, it would be greatly appreciated. Thank you.
ADDITION: Here's a partial code sample: Codepen
The code provided includes the section where the table is situated, focusing on the relevant CSS classes linked to the alignment issue rather than every single one used in the project. Even the experimental <p>
tag is included there.