Trying to recreate the image below, but facing alignment issues with the text in my code. How can I vertically align the text so that they are aligned like in the photo? Flexbox hasn't helped due to varying text lengths causing misalignment.
const storeItems = [
{
name: 'TV',
price: 800.00,
inStock: true,
details: '4K Ultra HD'
},
...
];
storeItems.forEach(function(n, i, a) {
if (n.inStock == true) {
$('.boxes').append('<div class="container">' + '<p>$' + n.price +'</p>' + '<p>' + n.name + '</p>' + '<p>' + n.details + '</p>'
+
'</div>');
}
if (n.inStock == false) {
$('.boxes').append('<p class="notInStock">' + n.name + ': $' +
n.price + ' Not in stock' + '</p>');
}
})
$('#clickMe').appendTo('.boxes');
$('#clickMe').click(function(){
$('#contentContainer').toggleClass('darkModeBackground');
$('.container').toggleClass('darkModeContainers');
$(this).toggleClass('darkModeClickMe');
})
body {
font-family: Helvetica;
background-color: #d3d3d3;
color: black;
}
.shrink-container {
width: 800px;
height: 50px;
margin: 0 auto;
}
...
<!DOCTYPE html>
<html>
...
</html>