I am having trouble aligning every single iteration of the values of the for loop appear on columns side by side. This is the output I have now. In the below picture I want to have Alberta and its value below to appear side to British Columbia.
The below is the way I am trying to have the values displayed.
Here is my HTML & CSS:
HTML:
<div>
<lightning-card>
<h1 slot="title" style="font-style:normal; font-family:'Candara';">
<template for:each={provinces} for:item="province">
<div class="province-stats" key={province.key}>
<div>{province.province}<br>
{province.internetOfferings}
</div>
</div>
</template>
</h1>
<div class="map-root" lwc:dom="manual"></div>
</lightning-card>
</div>
CSS:
.province-stats {
display: grid;
grid-template-columns: 24px 24px 24px 24px;
}
Best Answer
Why don't you try something simpler like building this out to use the
lightning-layout
? Inside the layout you can specify the details of each element or even include a new component for each one. you can also explore making a component and using it as a table column itself, this one i prefer.Using
lightning-layout
Using custom components with
:host
css