cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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.

            
              <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>
            
          
!
            
              * {
  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%;
  }
}
            
          
!
            
              /* 

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

*/
            
          
!
999px
🕑 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 ..................

Console