I need to display data in a table layout, but the design requires separation borders between cells.
After exploring different options, I found that using div
elements within the td
elements was the most effective solution.
Example:
<table>
<tr>
<td>
<div class="inner">
Content
</div>
</td>
</tr>
</table>
CSS:
table td {
padding: 15px 10px;
border-bottom: 1px solid #e5e5e5;
}
table td div.inner {
padding: 10px 25px 10px 0;
border-right: 1px solid #e5e5e5;
}
While this setup works well visually, there is an issue with the varying heights of the vertical lines created by the border-right
property on div.inner
.
I attempted setting a fixed height on div.inner
, but it caused alignment problems. Aligning the content vertically and maintaining equal heights for the separator lines has proven to be challenging.
Is there a way to ensure equal height for the vertical separator lines?
Alternatively, how can I maintain vertical alignment when using a fixed height on div.inner
?
Please note: Using line-height
to achieve the desired result is not feasible due to the presence of additional elements like progress bars within div.inner
.