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.

              %h1 Responsive Table

      %th Company
      %th Location
      %th{data: {label: 'Desc'}} Description
    %td Acme Company, LLC
    %td Denver, CO
    %td Lorem ipsum dolor sit amet consectetur adipisicing elit. Eos necessitatibus obcaecati quibusdam.
    %td Simple Corp
    %td Austin, TX
    %td Mollitia veritatis commodi deleniti provident quasi neque illum ipsa consequatur ullam facere, quidem minus nesciunt maxime architecto.
    %td ABC Generic Company
    %td Seattle, WA
    %td Nihil officia natus voluptas, at quasi impedit animi enim doloremque architecto.

%h2 Another Table

      %th{data: {label: '1'}} Label One
      %th{data: {label: '2'}} Label Two
      %th{data: {label: '3'}} Label Three
    %td A
    %td B
    %td C
  Blog post and instructions:
  %a{href: 'https://j.eremy.net/responsive-table/', target: '_blank'} j.eremy.net/responsive-table
// *Most* of this is necessary,
// but change the appearance to your liking
@media screen and (max-width: 767px)
    display: none
    display: block
    position: relative
    padding: 1.2em 0
      border-top: 1px solid #ccc
    display: table-row
      content: attr(data-label)
      display: table-cell
      font-weight: bold
      padding: 0.2em 0.6em 0.2em 0
      text-align: right
      content: ''
      position: absolute
      left: 0
      right: 0
      bottom: 0
      border-bottom: 1px solid #ccc
// None of this is required,
// but it makes the demo pretty
@import url('https://fonts.googleapis.com/css?family=Montserrat:500,700')
  padding: 5%
  font-family: 'Montserrat', sans-serif
  font-weight: 500
  line-height: 1.35
h1, h2
  font-size: 1.8em
  margin-bottom: 0.8em
  margin-bottom: 2em
  text-align: left
@media screen and (min-width: 768px)
    padding: 2.5em
  td, th
    padding: 0.4em 0.6em
    vertical-align: top
    border: 1px solid #ccc
    background: #e1e1e1
    font-weight: bold
    table = $(this);
    tableRow = table.find('tr');
      tdIndex = $(this).index();
      if ($(tableRow).find('th').eq(tdIndex).attr('data-label')) {
        thText = $(tableRow).find('th').eq(tdIndex).data('label');
      } else {
        thText = $(tableRow).find('th').eq(tdIndex).text();
      $(this).attr('data-label', thText + ':');
🕑 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 ..................