Hello Universe!
I'm on a quest to discover an elegant solution for presenting multiple lines of information within a
tag. Right now, I have the following setup:</p>
<pre><code><dl class="row">
<dt class="col-2">
Role Name
</dt>
<dd class="col-10">
Test Role
</dd>
<!-- IsActive -->
<dt class="col-2">
Active
</dt>
<dd class="col-10">
<input checked="checked" class="check-box" disabled="disabled" type="checkbox">
</dd>
<!-- Groups -->
<dt class="col-2">
Groups
</dt>
<dd class="col-10">
<ul class="list-group list-group-flush">
<li class="list-group-item">testadgroup1</li>
<li class="list-group-item">testadgroup2</li>
<li class="list-group-item">testadgroup3</li>
</ul>
</dd>
</dl>
Initially, I thought of utilizing the list-group class together with list-group-flush, along with some adjustments to the default CSS like so:
.list-group-item {
padding-left: .625rem;
padding-right: .625rem;
padding-top: .375rem;
padding-bottom: .375rem;
}
.list-group-item:first-of-type {
padding-top: 0rem;
}
This method works fine, but I sense there might be a more efficient way to achieve similar results that I haven't explored yet.
Additional details (if relevant):
- I'm working with Bootstrap 4 and ASP.NET MVC
- I'm open to using external libraries as long as they integrate well with Bootstrap 4
.list-group-item {
padding-left: .625rem;
padding-right: .625rem;
padding-top: .375rem;
padding-bottom: .375rem;
}
.list-group-item:first-of-type {
padding-top: 0rem;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet"/>
<dt class="col-2">
Role Name
</dt>
<dd class="col-10">
Test Role
</dd>
<!-- IsActive -->
<dt class="col-2">
Active
</dt>
<dd class="col-10">
<input checked="checked" class="check-box" disabled="disabled" type="checkbox">
</dd>
<!-- Groups -->
<dt class="col-2">
Groups
</dt>
<dd class="col-10">
<ul class="list-group list-group-flush">
<li class="list-group-item">testadgroup1</li>
<li class="list-group-item">testadgroup2</li>
<li class="list-group-item">testadgroup3</li>
</ul>
</dd>
</dl>