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

              
                <div class="container">
  <table class="table table--shaded">
    <thead class="table__head">
      <tr class="table__row">
        <td class="table__cell table__cell--checkbox table__cell--no-wrap">
          <input type="checkbox">
        </td>
        </td>
        <td class="UserTable__name table__cell table__cell--no-wrap">Name</td>
        <td class="table__cell table__cell--remainder">Description</td>
      </tr>
    </thead>
    <tbody class="table__body">
      <tr class="table__row">
        <td class="table__cell table__cell--checkbox table__cell--no-wrap">
          <input type="checkbox">
        </td>
        <td class="UserTable__name table__cell table__cell--no-wrap">Adam Cooke</td>
        <td class="table__cell table__cell--remainder">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempora atque esse sapiente labore dolores eos iste earum beatae doloremque delectus laborum dolorum ea ipsa, nihil, obcaecati perferendis similique. Porro, inventore?</td>
      </tr>
      <tr class="table__row">
        <td class="table__cell table__cell--checkbox table__cell--no-wrap">
          <input type="checkbox">
        </td>
        <td class="UserTable__name table__cell table__cell--no-wrap">Adam West</td>
        <td class="table__cell table__cell--remainder">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempora atque esse sapiente labore dolores eos iste earum beatae doloremque delectus laborum dolorum ea ipsa, nihil, obcaecati perferendis similique. Porro, inventore?</td>
      </tr>
      <tr class="table__row">
        <td class="table__cell table__cell--checkbox table__cell--no-wrap">
          <input type="checkbox">
        </td>
        <td class="UserTable__name table__cell table__cell--no-wrap">Charlie Smurthwaite</td>
        <td class="table__cell table__cell--remainder">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempora atque esse sapiente labore dolores eos iste earum beatae doloremque delectus laborum dolorum ea ipsa, nihil, obcaecati perferendis similique. Porro, inventore?</td>
      </tr>
      <tr class="table__row">
        <td class="table__cell table__cell--checkbox table__cell--no-wrap">
          <input type="checkbox">
        </td>
        <td class="UserTable__name table__cell table__cell--no-wrap">Dan Quinney</td>
        <td class="table__cell table__cell--remainder">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempora atque esse sapiente labore dolores eos iste earum beatae doloremque delectus laborum dolorum ea ipsa, nihil, obcaecati perferendis similique. Porro, inventore?</td>
      </tr>
      <tr class="table__row">
        <td class="table__cell table__cell--checkbox table__cell--no-wrap">
          <input type="checkbox">
        </td>
        <td class="UserTable__name table__cell table__cell--no-wrap">Dan Wentworth</td>
        <td class="table__cell table__cell--remainder">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempora atque esse sapiente labore dolores eos iste earum beatae doloremque delectus laborum dolorum ea ipsa, nihil, obcaecati perferendis similique. Porro, inventore?</td>
      </tr>
      <tr class="table__row">
        <td class="table__cell table__cell--checkbox table__cell--no-wrap">
          <input type="checkbox">
        </td>
        <td class="UserTable__name table__cell table__cell--no-wrap">Robert Lyall</td>
        <td class="table__cell table__cell--remainder">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempora atque esse sapiente labore dolores eos iste earum beatae doloremque delectus laborum dolorum ea ipsa, nihil, obcaecati perferendis similique. Porro, inventore?</td>
      </tr>
    </tbody>
  </table>
</div>
              
            
!

CSS

              
                $border-color: (
  light: #eaeaea,
  medium: #e0e0e0,
  dark: #d7d7d7
);

$font-weight: (
  light: 300,
  regular: 400,
  medium: 500,
  bold: 700
);

@function border-color($shade) {
  @return map-get($border-color, $shade);
}

@function font-weight($weight) {
  @return map-get($font-weight, $weight);
}

*,
*:after,
*:before {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  font: font-weight(regular) 14px/1.5 "Roboto", sans-serif;
}

input {
  margin: 0;
}

.container {
  margin: 24px auto;
  max-width: 960px;
}

.table {
  border-collapse: collapse;
  width: 100%;
}

.table--bordered {
  border: 1px solid map-get($border-color, dark);
}

.table--shaded {
  border-bottom: 2px solid #c6d5e3;
}

.table__head {
  border-bottom: 2px solid #c6d5e3;
  color: darken(#c6d5e3, 25%);

  .table--shaded & {
    background: #f7fafc;
  }
}

.table__row {
  &:not(:last-of-type) {
    border-bottom: 1px solid map-get($border-color, light);
  }
}

.table__cell {
  padding: 16px 12px 14px;

  .table__head & {
    padding: 10px 12px 8px;
  }
  
  .table--bordered &:not(:last-of-type) {
    border-right: 1px solid map-get($border-color, light);
  }
  
  .table__head & {
    font-weight: font-weight(bold);
  }
}

.table__cell--checkbox {
  max-width: 25px;
  padding: 16px 0 14px 12px;

  .table__head & {
    padding: 10px 0 8px 12px;
  }
}

.table__cell--no-wrap {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table__cell--remainder {
  width: 99%;
}

.UserTable__name {
  max-width: 200px;
}

              
            
!

JS

              
                
              
            
!
999px

Console