Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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.

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

              
                <section class="center">
  <div class="table__wrapper">
    <h1>Comparing Popular SmartPhones</h1>
    <table class="table" summary="This is a summary of your rad table contents.">
      <thead>
        <tr>
          <th scope="row"></th>
          <th scope="col">iPhone 6</th>
          <th scope="col">iPhone 6 Plus</th>
          <th scope="col">Galaxy Note 4</th>
          <th scope="col">HTC One (M8)</th>
          <th scope="col">Samsung Galaxy S5</th>
          <th scope="col">Nokia Lumia 830</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row">Screen Size</th>
          <td data-header="iPhone 6"><p>4.7 in</p></td>
          <td data-header="iPhone 6 Plus"><p>5.5 in</p></td>
          <td data-header="Galaxy Note 4"><p>5.7 in</p></td>
          <td data-header="HTC One (M8)"><p>5 in</p></td>
          <td data-header="Samsung Galaxy S5"><p>5.1 in</p></td>
          <td data-header="Nokia Lumia 830"><p>5 in</p></td>
        </tr>
        <tr>
          <th scope="row">Thickness</th>
          <td data-header="iPhone 6"><p>6.9 mm</p></td>
          <td data-header="iPhone 6 Plus"><p>7.1 mm</p></td>
          <td data-header="Galaxy Note 4"><p>8.5 mm</p></td>
          <td data-header="HTC One (M8)"><p>9.4 mm</p></td>
          <td data-header="Samsung Galaxy S5"><p>8.1 mm</p></td>
          <td data-header="Nokia Lumia 830"><p>8.5 mm</p></td>
        </tr>
        <tr>
          <th scope="row">Weight</th>
          <td data-header="iPhone 6"><p>129 g</p></td>
          <td data-header="iPhone 6 Plus"><p>172 g</p></td>
          <td data-header="Galaxy Note 4"><p>176 g</p></td>
          <td data-header="HTC One (M8)"><p>160 g</p></td>
          <td data-header="Samsung Galaxy S5"><p>145 g</p></td>
          <td data-header="Nokia Lumia 830"><p>150 g</p></td>
        </tr>
        <tr>
          <th scope="row">Storage</th>
          <td data-header="iPhone 6"><p>16/64/128 GB internal</p></td>
          <td data-header="iPhone 6 Plus"><p>16/64/128 GB internal</p></td>
          <td data-header="Galaxy Note 4"><p>32 GB internal, microSD slot up to 64 GB</p></td>
          <td data-header="HTC One (M8)"><p>16/32 GB internal, microSD slot up to 128 GB</p></td>
          <td data-header="Samsung Galaxy S5"><p>16/32 GB internal, microSD slot up to 128 GB</p></td>
          <td data-header="Nokia Lumia 830"><p>16/32 GB internal, microSD slot up to 128 GB</p></td>
        </tr>
        <tr>
          <th scope="row">Battery Life</th>
          <td data-header="iPhone 6"><p>Up to 14 hours talk on 3G, up to 50 hours music, up to <br />11 hours video</p></td>
          <td data-header="iPhone 6 Plus"><p>Up to 24 hours talk on 3G, up to 80 hours music, <br />up to 14 hours video</p></td>
          <td data-header="Galaxy Note 4"><p>Up to 20 hours talk, up to 82 hours music</p></td>
          <td data-header="HTC One (M8)"><p>Up to 20 hours talk on 3G</p></td>
          <td data-header="Samsung Galaxy S5"><p>Up to 21 hours talk, up to 67 hours music</p></td>
          <td data-header="Nokia Lumia 830"><p>Up to 14 hours 48 min talk on 3G, up to 78 hours music</p></td>
        </tr>
      </tbody>
    </table>
  </div>
</section>
              
            
!

CSS

              
                * {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

.table__wrapper {
  width: 100%;
}

.table__wrapper .table {
  width: 100%;
  max-width: 100%;
}


/* ------- Presentational Formatting --------- */
h1 {
  text-align: center;
}

.center {
  margin: 0 auto;
  width: 80%;
}

.table {
  border: 1px solid #f0f0f0;
  border-collapse: collapse;
}

.table tr {
  border-bottom: 1px solid #f0f0f0;
}

.table thead tr {
  border-bottom: 2px solid #f0f0f0;
}

.table td,
.table th {
  padding: .5em;
}

.table th {
  text-align: left;
}

@media screen and (max-width:991px) {
  .table {
    margin: 0 auto;
    width: 100%;
    border-spacing: 0;
  }
  .table thead {
    position: absolute;
    clip: rect(1px, 1px, 1px, 1px);
    padding: 0;
    border: 0;
    height: 1px;
    width: 1px;
    overflow: hidden;
  }
  .table tbody,
  .table tr,
  .table th,
  .table td {
    display: block;
    padding: 0;
    text-align: left;
    white-space: normal;
  }
  .table tr td,
  .table tr th {
    padding: 2em 1em;
    vertical-align: middle;
    overflow: hidden;
    position: relative;
    vertical-align: top;
    border: 1px solid #EDF0F1;
    border-top: none;
    width: 100%;
    white-space: normal;
  }
  .table th[scope="row"] {
    width: 100%;
    text-align: center;
    display: block;
    background-color: #B3BFC6;
    margin: 0 auto;
    padding: .5em 0;
  }
  .table td[data-header]:before {
    content: attr(data-header);
    display: block;
    float: left;
    width: 50%;
    color: #000000;
    font-weight: bold;
    text-align: left;
  }
  .table td[data-header] > * {
    display: block;
    width: 50%;
    float: right;
    clear: right;
    padding-left: 1em;
    margin-top: 0;
  }
  .table td[data-header]:after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    border-right: 1px solid #EDF0F1;
    padding-bottom: 200%;
    display: block;
  }
}

@media screen and (max-width: 600px) {
  .center {
    width: 100%;
  }
}
              
            
!

JS

              
                /* 

------------ No JS In this solution! --------------

*/
              
            
!
999px

Console