I'm currently constructing a grid using flexbox, but I've encountered some border and padding issues leading me to devise the following HTML structure:
https://jsfiddle.net/rqmdxcjo/
<div class="flex">
<div class="flex w-40">
<h3 class="pr-6 py-0.5">Row A</h3>
</div>
<div class="flex w-25 border-right">
<div class="py-0.5 px-6">AAA</div>
<div class="py-0.5 px-6">AAA</div>
</div>
<div class="flex w-25 border-right">
<div class="py-0.5 px-6">AAA</div>
<div class="py-0.5 px-6">AAA</div>
</div>
<div class="flex w-10">
<div class="pl-6 py-0.5">AAAA</div>
</div>
</div>
Everything looks great as shown below:
Row --------- AAA AAA | AAA AAA | AAA
The issue arises when dealing with strings of different lengths, like in this case - AAA vs AAAA vs AAAA. As you can see in the image and fiddle, the text on these lines remains left-aligned. I've attempted applying float: right and text-align: right at various points with no success.
https://i.sstatic.net/hCf45.png
https://jsfiddle.net/rqmdxcjo/
Any suggestions on how to right align the text in these cells while keeping the padding and border intact?