Please have a look at the image below
What I have been intending to do for embarrassingly quite sometime now is to reduce the span of the background color of the last item to make it equal to the other side. After fiddling around, I couldn't do it without messing up the alignment of the column in contrast with the rest of the row. Please do take note that I'm trying to do this without using pixels(px) as a requirement.
Here's my code
HTML
<div class="container">
<div class="row title">
<div>Column 1</div>
<div>Column 2</div>
<div>Column 3</div>
<div>Column 4</div>
</div>
<div class="row item-1">
<div>Sample Title 1</div>
<div>1</div>
<div>10</div>
<div>100</div>
</div>
<div class="row item-1">
<div>Column 2</div>
<div>2</div>
<div>20</div>
<div>200</div>
</div>
<div class="row item-1">
<div>Column 3</div>
<div>3</div>
<div>30</div>
<div>300</div>
</div>
</div>
CSS
body {
background-color: purple;
color: #fff;
}
.container {
margin-left: 10vw;
margin-top: 5vw;
}
.row {
display: flex;
margin-top: 4vh;
width: 45vw;
}
.row > div {
width: 12vw;
}
.row > div:not(:first-child) {
text-align: center;
}
.container > div:last-child {
background-color: grey;
border-radius: 100px;
padding-left: 2vw;
margin-left: -2vw;
}
Link to codepen https://codepen.io/anon/pen/KxmJeM
I tried changing the width of the flex items within the last row but I have no dice finding the right combination and fiddling with the padding on the right side but that wouldn't work too.
Thank you for your help