cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <div class="container">
  <div class="row">
    <div class="col-xs-4 col-xs-offset-8">
      <input id="searchfield" type="search" class="form-control" placeholder="Search...">
    </div>
  </div>

  <div class="row">
    <div class="col-xs-12">
      <table>
        <thead>
          <tr id="days">
            <td style="width: 40%"></td>
            <td style="width: 12%" class="text-center">
              <h6><b class="schedule-color pressable-day" id="1">Monday</b></h6>
            </td>
            <td style="width: 12%" class="text-center">
              <h6><b class="schedule-color pressable-day" id="2">Tuesday</b></h6>
            </td>
            <td style="width: 12%" class="text-center">
              <h6><b class="schedule-color pressable-day" id="3">Wednesday</b></h6>
            </td>
            <td style="width: 12%" class="text-center">
              <h6><b class="schedule-color pressable-day" id="4">Thursday</b></h6>
            </td>
            <td style="width: 12%" class="text-center">
              <h6><b class="schedule-color pressable-day" id="5">Friday</b></h6>
            </td>
          </tr>

          <tr class="row-border">
            <td></td>
            <td class="text-center">
              <h6 class="schedule-color"><b data-id="count1">7 / 10</b></h6>
            </td>
            <td class="text-center">
              <h6 class="schedule-color"><b data-id="count2">2 / 10</b></h6>
            </td>
            <td class="text-center">
              <h6 class="schedule-color"><b data-id="count3">4 / 10</b></h6>
            </td>
            <td class="text-center">
              <h6 class="schedule-color"><b data-id="count4">5 / 10</b></h6>
            </td>
            <td class="text-center">
              <h6 class="schedule-color"><b data-id="count5">3 / 10</b></h6>
            </td>
          </tr>
        </thead>

        <tbody class="searchable">
          <tr class="row-border">
            <td>
              <h4>John Johnson</h4>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="1"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="2"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="3"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="4"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="5"></span>
            </td>
          </tr>

          <tr class="row-border">
            <td>
              <h4>Bo Johanson</h4>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="1"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="2"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="3"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="4"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="5"></span>
            </td>
          </tr>

          <tr class="row-border">
            <td>
              <h4>Bjorn Sorensen</h4>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="1"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="2"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="3"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="4"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="5"></span>
            </td>
          </tr>

          <tr class="row-border">
            <td>
              <h4>Sigurd Gabriel</h4>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="1"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="2"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="3"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="4"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="5"></span>
            </td>
          </tr>

          <tr class="row-border">
            <td>
              <h4>Jesper Christensen</h4>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="1"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="2"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="3"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="4"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="5"></span>
            </td>
          </tr>

          <tr class="row-border">
            <td>
              <h4>Nikiti Hansen</h4>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="1"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="2"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="3"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="4"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="5"></span>
            </td>
          </tr>

          <tr class="row-border">
            <td>
              <h4>Martin Hansen</h4>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="1"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="2"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="3"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="4"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="5"></span>
            </td>
          </tr>

          <tr class="row-border">
            <td>
              <h4>Joshua Bush</h4>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="1"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="2"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="3"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="4"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="5"></span>
            </td>
          </tr>

          <tr class="row-border">
            <td>
              <h4>Bill Billsen</h4>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="1"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="2"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="3"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="4"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="5"></span>
            </td>
          </tr>

          <tr class="row-border">
            <td>
              <h4>Terkil Ingren</h4>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="1"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="2"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking" data-schedule="3"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="4"></span>
            </td>
            <td class="text-center">
              <span class="glyphicon glyphicon-ok booking active" data-schedule="5"></span>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>

<br/>
<footer class="text-center">
  <p>&copy; 2016 - <a href="http://caveofcode.com" target="_blank">Cave of Code</a></p>
</footer>

            
          
!
            
              table {
  width: 100%;
}

#searchfield {
  margin-bottom: 10px;
  margin-top: 15px;
  padding-right: 5%
}

.pressable-day {
  padding: 10px 20px 10px 20px;
  cursor: pointer;
}

.pressable-day.active {
  background-color: forestgreen;
  color: white;
  border-radius: 50px;
}

.schedule-color {
  color: forestgreen;
}

.row-border {
  border-bottom-width: 0.1em;
  border-bottom-style: solid;
  border-bottom-color: rgba(192, 192, 192, 1.0)
}

h4 {
  line-height: 2em;
  color: black;
  text-decoration: underline;
}

.booking.glyphicon-ok {
  font-size: 2em;
  color: forestgreen;
  opacity: 0.1;
}

.booking.glyphicon-ok.active {
  opacity: 1;
}

            
          
!
            
              $(function() {
  $('#searchfield').keyup(filter);

  $('.pressable-day').click(function() {
    $(this).toggleClass('active');

    filter();
  });

  function filter() {
    var rex = new RegExp($('#searchfield').val(), 'i');
    var rows = $('.searchable tr');

    rows.hide();

    rows.filter(function() {

      var tester = true;

      tester = rex.test($(this).text());

      tester = tester && filterOnDays(this);

      return tester;
    }).show();
  }

  function filterOnDays(selector) {
    var tester = true;
    var all = $('#days .pressable-day.active');

    for (var i = 0; i < all.length; i++) {
      var day = $(selector).find('[data-schedule="' + all[i].id + '"]');

      if (!day.hasClass('active')) {
        tester = false;
      }
    }
    return tester;
  }
});

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console