JSFiddle - React, Tailwind, and code Playground
HTML
<div class="wrap">
<div id="table1" class="table wrap-list">
<div class="row header-row">
<span class="cell primary icon">Team</span>
<span class="cell header-cell" title="Games Played">GP</span>
<span class="cell header-cell" title="Wins">W</span>
<span class="cell header-cell" title="Draws">D</span>
<span class="cell header-cell" title="Losses">L</span>
<span class="cell header-cell" title="Goals For">GF</span>
<span class="cell header-cell" title="Goals Against">GA</span>
<span class="cell header-cell" title="Goals Difference">GD</span>
<span class="cell header-cell points" title="Points">PTS</span>
</div>
<div class="row hover-row">
<input type="radio" name="expand">
<span class="cell primary icon" data-label="Team">Team5</span>
<span class="cell" data-label="GP">0</span>
<span class="cell" data-label="W">0</span>
<span class="cell" data-label="D">0</span>
<span class="cell" data-label="L">0</span>
<span class="cell" data-label="GF">0</span>
<span class="cell" data-label="GA">0</span>
<span class="cell" data-label="GD">0</span>
<span class="cell points" data-label="PTS">0</span>
</div>
<div class="row row-last hover-row">
<input type="radio" name="expand">
<span class="cell cell-last primary icon icon-last" data-label="Team" id="6">Team6</span>
<span class="cell cell-last" data-label="GP">0</span>
<span class="cell cell-last" data-label="W">0</span>
<span class="cell cell-last" data-label="D">0</span>
<span class="cell cell-last" data-label="L">0</span>
<span class="cell cell-last" data-label="GF">0</span>
<span class="cell cell-last" data-label="GA">0</span>
<span class="cell cell-last" data-label="GD">0</span>
<span class="cell cell-last points" data-label="PTS">0</span>
</div>
</div>
</div>
CSS
body {
background: #cacaca;
margin: 0;
padding: 20px;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
}
.header-cell {
text-decoration: none;
cursor: help;
}
.table {
display: table;
line-height: 35px;
background: #fff;
margin: 0;
box-sizing: border-box;
}
#wrap2 {
margin-top: 1%;
}
.header-row {
background: #8b8b8b;
color: #fff;
}
.row {
display: table-row;
}
.cell {
display: table-cell;
padding: 6px;
border-bottom: 1px solid #e5e5e5;
text-align: center;
}
.cell-last {
border-bottom: none;
}
.primary {
text-align: left;
}
input[type="radio"],
input[type="checkbox"] {
display: none;
}
.hover-row:hover {
background-color: #FFEFC6;
border-radius:10px;
}
@media only screen and (max-width: 760px) {
body {
padding: 0;
}
.table {
display: table;
width: 100%;
}
.row {
position: relative;
display: block;
border-bottom: 1px solid #ccc;
}
.row-last {
border-bottom: none;
}
.header-row {
display: none;
}
.cell {
display: block;
border: none;
position: relative;
height: 45px;
line-height: 45px;
text-align: left;
}
.primary:after {
content: "";
display: block;
position: absolute;
right: 20px;
top: 18px;
z-index: 2;
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 10px solid #ccc;
}
.cell:nth-of-type(n+2) {
display: none;
}
input[type="radio"],
input[type="checkbox"] {
display: block;
position: absolute;
z-index: 1;
width: 99%;
height: 100%;
opacity: 0;
}
input[type="radio"]:checked,
input[type="checkbox"]:checked {
z-index: -1;
}
input[type="radio"]:checked ~ .cell,
input[type="checkbox"]:checked ~ .cell {
display: block;
border-bottom: 1px solid #eee;
}
...