When printing a list of data in observable format, I want to divide the screen into 3 columns to resemble a table. However, each cell is not occupying the same length, causing alignment issues.
<div class="card">
<div class="card-header main-header">
<h3 style="text-align: center;font-weight: 600;">Roles</h3>
</div>
<div class="card-header">
<span class="list-column">RoleName</span>
<span class="list-column">Description</span>
<span class="list-column">Action</span>
</div>
<ul class="list-group">
<li *ngFor="let item of userRoles; let i = index">
<span class="list-item">{{item.roleName}}</span>
<span class="list-item">{{item.roleDesc}}</span>
<span class="list-item">
<a href="">Edit</a> /
<a href="">Delete</a> /
</span>
</li>
<br />
</ul>
</div>
This can be solved by adding some CSS styles:
ul {
list-style-type: none;
padding-top: 20px;
}
.list-column {
font-size: 15px;
margin: 140px;
}
.list-item {
font-size: 12px;
margin: 140px;
align-items: center;
}
.wrapper {
width: 100%;
font-size: 0;
}