A live demo link speaks a thousand words: https://stackblitz.com/edit/angular-5vwspd
As you can see, the first 2 days are places awkwardly.
I'm creating a calendar component, and to display the day numbers (eg 1,2,...,31) I have a days
array. But in order for the 1
to appear under the right weekday (eg Tu) I need to pad days
with empty strings.
However, these empty strings are causing strange placement issues. The elements of the empty string are placed higher than the others.
For example, in my .ts
file:
days = ['','','',...,'30','31'];
In my .html
file:
<li *ngFor="let day of days">
<div class="dayNumber">
{{day}}
</div>
</li>