I'm struggling with getting my divs to look like a table, especially when it comes to highlighting a selected row. I've tried adjusting padding and margins without success. Does anyone have any suggestions on how I can achieve this effect?
.table {
display: table;
}
.header {
display: table-header-group;
font-weight: bold;
}
.row {
display: table-row-group;
}
.cell {
display: table-cell;
border: 1px solid black;
padding: 5px;
}
.selected {
background: red;
margin: 20px;
border: 1px solid red;
border-radius: 10px;
}
<div class="table">
<div class="header">
<div class="cell">Header 1</div>
<div class="cell">Header 2</div>
</div>
<div class="row selected">
<div class="cell">Row 1 Cell 1</div>
<div class="cell">Row 1 Cell 2</div>
</div>
<div class="row">
<div class="cell">Row 2 Cell 1</div>
<div class="cell">Row 2 Cell 2</div>
</div>
<div class="row">
<div class="cell">Row 3 Cell 1</div>
<div class="cell">Row 3 Cell 2</div>
</div>
</div>