I have a class with 4 distinct columns.
div class="mainContent">
<div class="left-Col-1" *ngIf="data-1">
</div>
<div class="left-Col-2" *ngIf="!data-1">
</div>
<div class="right-Col-1" *ngIf="data-2">
</div>
<div class="right-Col-2" *ngIf="!data-2">
</div>
</div>
Essentially, I have set up a flexbox to display two columns. If there is no data in the first column (data-1), the right-Col-2 div will be shown instead, and vice versa for the second column with data-2 triggering left-Col-2. When both columns contain data, left-Col-1 and right-Col-1 are displayed. My CSS structure is as follows:
.mainContent > *:nth-child(1){
display: flex;
flex-direction: column;
flex-basis: 70%;
padding: 0;
}
.mainContent > *:nth-child(2){
display: flex;
flex-direction: column;
flex-basis: 30%;
padding: 0;
}
The issue arises when I want to adjust flex-basis to 50% for both divs if no data is loaded (left-Col-2 and right-Col-2). Can this adjustment be achieved solely through CSS, or would I need to implement a TypeScript function?
Thank you for any assistance provided.