I’m trying to create a table-like layout using bootstrap 4 and having difficulties understanding how to properly use borders.
Please take a look at the code extract:
<div class="row">
<div class="col-4 border-right border-primary">Name</div>
<div class="col ml-1">Alice</div>
</div>
<div class="row mt-3">
<div class="col-4 border-right border-primary">Surname</div>
<div class="col ml-1">Smith</div>
</div>
It creates a table-like layout but due to second row having top margin the right border has a gap between the rows.
What are the possible ways to resolve this issue?
2
Answers
You can use pt-3 to
inner col
class inside row for padding-topUse padding instead of margin: