As you can see in the snippet I've applied to this question, the alignment is ruined because the different divs have different width based on the text inside of them.
I want the biggest div's width of each column to be determined by the length of the text inside of it and have all the rest of the divs to take that width. I don't want to hardcode any width and I can't alter the HTML structure too much.
I want the end result to be something like this:
Is there anything that can be done
.match {
display: flex;
}
.justify-center {
display: flex;
justify-content: center;
align-items: center;
}
.matches-container div {
margin-right: 20px;
padding: 10px;
}
.match:nth-child(odd) {
background-color: #d0d0d0;
}
.match:nth-child(even) {
background-color: #e4b2b2;
}
<div class='matches-container'>
<div class='match'>
<div class='justify-center'>
<p>George</p>
</div>
<div class='justify-center'>
<p>Level 10</p>
</div>
<div class='justify-center'>
<p>Ranger</p>
</div>
</div>
<div class='match'>
<div class='justify-center'>
<p>Mia</p>
</div>
<div class='justify-center'>
<p>Level 10</p>
</div>
<div class='justify-center'>
<p>Ranger</p>
</div>
</div>
<div class='match'>
<div class='justify-center'>
<p>Ivan</p>
</div>
<div class='justify-center'>
<p>Level 9999</p>
</div>
<div class='justify-center'>
<p>Wizard</p>
</div>
</div>
</div>