Perhaps this may help you:
.table { display: table; border: 1px solid black; border-bottom: 0; } .row { display: table-row-group; } .header .{ display: table-header-group; font-weight: bold; } .cell { display: table-cell; padding: 5px; border-bottom: 1px solid black; } .cell:first-child{ border-right: 1px solid black; } .selected + .row .cell{ border-top: 1px solid black; } .selected .cell{ background: red; } .selected .cell:first-child{ border-right: 0; border-radius: 10px 0 0 10px; border-bottom: 0px; } .selected .cell:nth-child(2){ border-radius: 0 10px 10px 0; border-bottom: 0px; }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JS Bin</title> </head> <body> <div class="table"> <div class="row 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 footer"> <div class="cell">Row 3 Cell 1</div> <div class="cell">Row 3 Cell 2</div> </div> </body> </html>
The only problem is that the padding property is not applicable for display: table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column.
Link: https://developer.mozilla.org/en-US/docs/Web/CSS/padding
Example: http://jsbin.com/tofokoriri/edit?html,css,output
source share