JSFiddle - React, Tailwind, and code Playground

by matt9388

HTML

<div class="match-table-container">
  <div class="match-table-header">
    Steam
    <i class="fa fa-minus-circle"></i>
  </div>
  <div class="match-table-parent scrollbars">
    <table class="match-table">
      <thead style="">
      <tr >
        <th>Username</th>
        <th>Rep</th>
        <th>Earnings</th>
        <th>Game Mode</th>
        <th>W&nbsp;/&nbsp;L</th>
      </tr>
      </thead>
      <tbody style="oveflow:hidden; overflow-y:scroll; height:200px; display:block;">
      <tr class="ani">
        <td data-th="Username">RocketJohn</td>
        <td data-th="Rep">2,643</td>
        <td data-th="Earnings">$72.15</td>
        <td data-th="Game Mode">Soccar</td>
        <td data-th="Today's W/L">3&nbsp;/&nbsp;7</td>
      </tr>
      <tr class="ani">
        <td data-th="Username">RocketJohn</td>
        <td data-th="Rep">2,643</td>
        <td data-th="Earnings">$72.15</td>
        <td data-th="Game Mode">Soccar</td>
        <td data-th="Today's W/L">3&nbsp;/&nbsp;7</td>
      </tr>
      <tr class="ani">
        <td data-th="Username">RocketJohn</td>
        <td data-th="Rep">2,643</td>
        <td data-th="Earnings">$72.15</td>
        <td data-th="Game Mode">Soccar</td>
        <td data-th="Today's W/L">3&nbsp;/&nbsp;7</td>
      </tr>
      <tr class="ani">
        <td data-th="Username">RocketJohn</td>
        <td data-th="Rep">2,643</td>
        <td data-th="Earnings">$72.15</td>
        <td data-th="Game Mode">Soccar</td>
        <td data-th="Today's W/L">3&nbsp;/&nbsp;7</td>
      </tr>
      <tr class="ani">
        <td data-th="Username">RocketJohn</td>
        <td data-th="Rep">2,643</td>
        <td data-th="Earnings">$72.15</td>
        <td data-th="Game Mode">Soccar</td>
        <td data-th="Today's W/L">3&nbsp;/&nbsp;7</td>
      </tr>
      <tr class="ani">
        <td data-th="Username">RocketJohn</td>
        <td data-th="Rep">2,643</td>
        <td data-th="Earnings">$72.15</td>
        <td data-th="Game Mode">Soccar</td>
       ...

CSS

body {
  background: #181818;
}
.match-table-game {}

.match-table-game img {
  width: 120px;
}

.match-table-game h3 {
  text-align: center;
  font-size: 34px;
  color: #ddd;
  font-family: 'Play', sans-serif;
}


/* mobile style is delegated first, anything above 480px in width is at bottom */

.match-table-container {
  box-shadow: 0 0 12px rgba(0, 0, 20, 0.5);
}

.match-table-container:first-of-type {
  margin-top: 30px;
}

.match-table-header {
  margin: 0 2px;
  padding: 12px 0 6px;
  font-family: 'Play', sans-serif;
  color: #dedede;
  font-size: 32px;
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  text-shadow: 0 0 12px #004;
  background: rgba(0, 66, 24, 0.3);
  /*#004218*/
  border-radius: 2px 2px 0 0;
  border-bottom: 1px solid rgba(0, 0, 20, 0.3);
  cursor: pointer;
  position: relative;
  z-index: 0;
}

.match-table-header > img {
  position: absolute;
  bottom: 6px;
  left: 16px;
  width: 35px;
  height: 35px;
}

.match-table-header > i {
  position: absolute;
  bottom: 16px;
  right: 18px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #333;
  color: #aaa;
}

.match-table-parent {
  /* container div for slideUp/Down */
  /*overflow-y: scroll;
  overflow-x: hidden;
  max-height: 200px;*/
}

.match-table {
  margin: 0;
  min-width: 280px;
  width: 100%;
  background: rgba(0, 0, 20, 0.5);
  color: #fff;
  border-radius: 0 0 4px 4px;
  /*overflow: hidden;*/
  position: relative;
}

.match-table tr {
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  display:block;
}

.match-table tr:first-of-type {
  background: rgba(0, 40, 65, 0.5) !important;
  /*#004A75 !important;*/
  color: #fff !important;
   display:block;
}

.match-table th {
  display: none;
  border-left: 1px solid #003A5C !important;
}

.match-table th:first-of-type {
  border-left: none !important;
}

.match-table td {
  display: block;
  border: none;
  outline: none;
  margin: 0;
}

.match-table td:first-child {
  padding-top:...

JavaScript

$(function() {
  $('.match-table-header').unbind('click').click(function() {
    var table = $(this).siblings('.match-table-parent');
    if (table.is(':visible')) {
      $(this).find('i').removeClass('fa-minus-circle').addClass('fa-plus-circle');
      table.slideUp();
    } else {
      $(this).find('i').removeClass('fa-plus-circle').addClass('fa-minus-circle');
      table.slideDown();
    }
  });
});