I am currently in the process of developing a calendar using Bootstrap and React, but I have encountered an issue with the calendar's design. The text on the top row that displays the weekdays is not aligning perfectly with the "day" items below it. These "day" items will eventually be replaced with numbers instead of text.
After experimenting with the code, I believe the problem is related to the length of the text itself. However, I am struggling to find a solution to ensure everything lines up correctly.
Here is the code snippet:
.calendar {
text-align: center;
}
.calendar--weekdays li {
padding: 5px 20px;
}
.calendar--week li {
padding: 5px 20px;
}
.calendar--row {
display: flex;
justify-content: center;
flex-direction: row;
}
.calendar--row p {
padding: 10px 15px;
margin: 0px;
}
.event__viewer {
text-align: center;
}
<head>
<!-- Font Awesome -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
</head>
<body>
<div id="container" class="container">
<div class="row">
<div class="col-lg-6">
<div class="calendar">
<h1>My Calendar</h1>
<div class="calendar">
<div class="calendar--row calendar--weekdays">
<p>Sun</p>
<p>Mon</p>
<p>Tue</p>
<p>Wed</p>
<p>Thur</p>
<p>Fri</p>
<p>Sat</p>
</div>
<div class="calendar--row calendar--week">
<p>day</p>
<p>day</p>
<p>day</p>
<p>day</p>
<p>day</p>
<p>day</p>
<p>day</p>
</div>
<!-- Additional week rows -->
</div>
<div class="calendar--tools">
<i class="fa fa-arrow-left" aria-hidden="true"></i>
<span> Month </span>
<i class="fa fa-arrow-right" aria-hidden="true"></i>
</div>
</div>
</div>
<div class="col-lg-6 event__viewer">
<h1>Events</h1>
</div>
</div>
</div>
</body>
Any suggestions or thoughts on how to address this issue?