Recently, I created an HTML table using Bootstrap V5 on my website.
.reasonCode-table th, .reasonCode-table td {
padding: 8px;
border: 2px solid #7a7878;
border-radius: 6px;
}
.reasonCode-table__title {
text-align: center;
}
.reasonCode-table__items {
vertical-align: middle;
text-align: center;
}
.reasonCode-table thead th {
border-top: none;
border-right: none;
border-left: none;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="67050808131413150617275249554954">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"/>
<table class="table reasonCode-table">
<tbody>
<tr>
<td class="col-md-1 reasonCode-table__items">F123</td>
<td class="col-md-2 reasonCode-table__items">X987Y</td>
<td class="col-md-9 last-column">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Phasellus facilisis, urna eget lacinia lacinia, mauris quam
gravida elit.
</td>
</tr>
<tr>
<td class="reasonCode-table__items">G456</td>
<td class="reasonCode-table__items">Z654W</td>
<td class="last-column">
Nullam fringilla consectetur nunc, sit amet tincidunt eros
congue ut.
</td>
</tr>
<tr>
<td class="reasonCode-table__items">H789</td>
<td class="reasonCode-table__items">P123Q</td>
<td class="last-column">
Fusce vel dolor vel odio volutpat laoreet eget eu elit.
</td>
</tr>
<tr>
<td class="reasonCode-table__items">J012</td>
<td class="reasonCode-table__items">L567M</td>
<td class="last-column" colspan="2">
Sed id nunc sit amet lectus feugiat fermentum.
</td>
</tr>
<tr>
<td class="reasonCode-table__items">K345</td>
<td class="reasonCode-table__items">H789K</td>
<td class="last-column">
Mauris hendrerit bibendum mi, in tincidunt nisi dapibus at.
</td>
</tr>
</tbody>
</table>
I have encountered an issue where the table does not have the desired border-radius when displayed. I attempted to add it to the parent element .reasonCode-table and even tried wrapping everything within another <div>
, but without success. Can anyone provide insight on how to overcome this challenge?
Thank you.