When using vue.js, I create a table from an object that should have two columns. Each column is generated from the key and value of the object. Here is the equivalent HTML:
<div id="table">
<div>
<div>
this is something long on the first row
</div>
<div>
short 1st row
</div>
</div>
<div>
<div>
wazaa 2nd row
</div>
<div>
wazii 2nd row
</div>
</div>
</div>
To format these div
into a 2x2 grid, I use CSS grid with the following code:
#table {
display: grid;
grid-template-columns: auto 1fr;
}
<div id="table">
<div>
<div>
this is something long on the first row
</div>
<div>
short 1st row
</div>
</div>
<div>
<div>
wazaa 2nd row
</div>
<div>
wazii 2nd row
</div>
</div>
</div>
However, the result does not match my expectation. The two deepest div
stack on top of each other instead of aligning in the defined grid.
I want them to follow the grid behavior and align based on the column templates. How can I achieve this?