Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <table class="invert">
  <thead>
    <tr>
      <th></th>
      <th>Time</th>
      <th>Time</th>
      <th>Time</th>
      <th>Time</th>
      <th>Time</th>
      <th>Time</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>Date</th>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <th>Date</th>
      <td>
        <div class="evt event1">Event 1</div>
      </td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <th>Date</th>
      <td></td>
      <td>
        <div class="evt event2">Event 2</div>
      </td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <th>Date</th>
      <td></td>
      <td></td>
      <td>
        <div class="evt event3">Event 3</div>
      </td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <th>Date</th>
      <td></td>
      <td></td>
      <td></td>
      <td>
        <div class="evt event4">Event 4</div>
      </td>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <th>Date</th>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <th>Date</th>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
  </tbody>
</table>
              
            
!

CSS

              
                /* This part would be in a static external css*/

table.invert {
  display: block;
  width: 95%;
  margin: 0 auto;
}

.invert tbody,
.invert thead,
.invert tr {
  display: inline-block;
  /* Make rows display side by side */
}

.invert th,
.invert td {
  display: block;
  /* Make cells stack vertical in the rows */
  outline: dashed 1px #aaa;
  position: relative;
  overflow: visible;
  min-width: 5em;
  min-height: 1.5em;
}

.invert th {
  background: #cef
}

.invert thead th {
  background: #cfe
}

.evt {
  position: absolute;
  width: 90%;
  top: 0;
  right: 2px;
  background: #faa;
  outline: solid 1px #f00;
}

@media screen and (max-width: 48em) {
  /* On the small screen */
  .invert tr {
    display: block;
    /* Make rows stack vertical */
  }
  .invert thead {
    display: none
    /* Hide the head */
  }
  .invert tbody {
    width: 100%
  }
  .invert td::before {
    /* Replace heads with pseudo elements,
    in real life this would use dynamically created data attribute */
    content: 'Time:';
    font-weight: bold;
    background: #cfe;
  }
  .evt {
    width: auto;
    left: 5em;
  }
}


/* This part would be churned out here dynamically from your data */

.event1 {
  height: 6em;
}

.event2 {
  height: 2em;
}

.event3 {
  height: 5em;
}

.event4 {
  height: 3em;
}
              
            
!

JS

              
                
              
            
!
999px

Console