css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

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

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

    %th Mon
    %th Tue
    %th Wed
    %th Thu
    %th Fri
    %th Sat
    %th Sun
    %td 1
    %td 2
    %td 3
    %td 4
    %td 5
    %td 6
    %td 7
    %td 8
    %td 9
    %td 10
    %td 11
    %td 12
    %td 13
    %td 14
    %td 15
    %td 16
    %td 17
    %td 18
    %td 19
    %td 20
    %td 21
    %td 23
    %td 24
    %td 25
    %td 26
    %td 27
    %td 28
    %td 29
    %td 30
%script{src: "//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"}
  background-color: #eee
  padding: 2em 0

  background-color: #fff
  border-collapse: collapse
  margin-left: auto
  margin-right: auto
  width: 500px

th, td
  border: 1px solid #ccc
  font-family: Helvetica, sans-serif
  width: 14.28%

  font-size: 12px
  line-height: 20px

  cursor: default
  line-height: 4
  text-align: center
    background-color: rgba(254, 171, 41, 0.2)
    background-color: rgba(254, 171, 41, 0.4)

              $(function() {
  var clickCount = 0;
  // add an index to each cell
  $('td').each(function(i) {
    $(this).attr('data-num', i);    
  // select cell clicked on
  .on('click', function() {
    if(clickCount < 2) {
      // make selection on second click
      if(clickCount == 1) {
    else {
      // cancel previous selection and start again
      clickCount = 1;
  // hover highlight selection
  $('table').delegate('td', 'mouseenter', function() {
    if($('.selected').length == 1) {
      var selectedIndex = parseInt($('.selected').attr('data-num')),
          currentHoverIndex = parseInt($(this).attr('data-num'));  

      // highlight after first selection 
      if(selectedIndex < currentHoverIndex) {
        $('td').slice(selectedIndex+1, currentHoverIndex+1).addClass('hovering');
      // highlight before first selection
      else if(currentHoverIndex < selectedIndex) {
        $('td').slice(currentHoverIndex, selectedIndex).addClass('hovering');
🕑 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 ..................