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. 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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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 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.

HTML

              
                <table id="respTable">
  <thead>
    <tr>
      <th>Number</th>
      <th>Player</th>
      <th>Position</th>
      <th>Height</th>
      <th>Weight</th>
      <th>D.O.B.</th>
      <th>Experience</th>
      <th>From</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span>0</span></td>
      <td>
        <span><a href="http://www.wnba.com/player/alana-beard/" target="_blank">Alana Beard</a></span></td>
      <td><span>G-F</span></td>
      <td><span>5-11</span></td>
      <td><span>160</span></td>
      <td><span>May 14, 1982</span></td>
      <td><span>12</span></td>
      <td><span>Duke/USA</span></td>
    </tr>
    <tr>
      <td><span>17</span></td>
      <td>
        <span><a href="http://www.wnba.com/player/essence-carson/" target="_blank">Essence Carson</a></span></td>
      <td><span>F-G</span></td>
      <td><span>6-0</span></td>
      <td><span>163</span></td>
      <td><span>July 28, 1986</span></td>
      <td><span>10</span></td>
      <td><span>Rutgers/USA</span></td>
    </tr>
    <tr>
      <td><span>12</span></td>
      <td>
        <span><a href="http://www.wnba.com/player/chelsea-gray/" target="_blank">Chelsea Gray</a></span></td>
      <td><span>G</span></td>
      <td><span>5-11</span></td>
      <td><span>170</span></td>
      <td><span>October 8, 1992</span></td>
      <td><span>3</span></td>
      <td><span>Duke</span></td>
    </tr>
    <tr>
      <td><span>42</span></td>
      <td>
        <span><a href="http://www.wnba.com/player/jantel-lavender/" target="_blank">Jantel Lavender</a></span></td>
      <td><span>C</span></td>
      <td><span>6-4</span></td>
      <td><span>185</span></td>
      <td><span>November 12, 1988</span></td>
      <td><span>7</span></td>
      <td><span>Ohio State/USA</span></td>
    </tr>
    <tr>
      <td><span>30</span></td>
      <td>
        <span><a href="http://www.wnba.com/player/nneka-ogwumike/" target="_blank">Nneka Ogwumike</a></span></td>
      <td><span>F</span></td>
      <td><span>6-2</span></td>
      <td><span>174</span></td>
      <td><span>July 2, 1990</span></td>
      <td><span>6</span></td>
      <td><span>Stanford/USA</span></td>
    </tr>
    <tr>
      <td><span>3</span></td>
      <td>
        <span><a href="http://www.wnba.com/player/candace-parker/" target="_blank">Candace Parker</a></span></td>
      <td><span>F-C</span></td>
      <td><span>6-4</span></td>
      <td><span>175</span></td>
      <td><span>April 19, 1986</span></td>
      <td><span>10</span></td>
      <td><span>Tennessee/USA</span></td>
    </tr>
    <tr>
      <td><span>44</span></td>
      <td>
        <span><a href="http://www.wnba.com/player/karlie-samuelson/" target="_blank">Karlie Samuelson</a></span></td>
      <td><span>G</span></td>
      <td><span>6-0</span></td>
      <td><span></span></td>
      <td><span>May 10, 1995</span></td>
      <td><span>R</span></td>
      <td><span>Stanford</span></td>
    </tr>
    <tr>
      <td><span>1</span></td>
      <td>
        <span><a href="http://www.wnba.com/player/odyssey-sims/" target="_blank">Odyssey Sims</a></span></td>
      <td><span>G</span></td>
      <td><span>5-8</span></td>
      <td><span>160</span></td>
      <td><span>July 13, 1992</span></td>
      <td><span>4</span></td>
      <td><span>Baylor</span></td>
    </tr>
    <tr>
      <td><span>10</span></td>
      <td>
        <span><a href="http://www.wnba.com/player/maria-vadeeva/" target="_blank">Maria Vadeeva</a></span></td>
      <td><span>C</span></td>
      <td><span>6-4</span></td>
      <td><span></span></td>
      <td><span>July 16, 1998</span></td>
      <td><span>R</span></td>
      <td><span>Russia</span></td>
    </tr>
    <tr>
      <td><span>24</span></td>
      <td>
        <span><a href="http://www.wnba.com/player/sydney-wiese/" target="_blank">Sydney Wiese</a></span></td>
      <td><span>G</span></td>
      <td><span>6-0</span></td>
      <td><span></span></td>
      <td><span>June 16, 1995</span></td>
      <td><span>1</span></td>
      <td><span>Oregon State</span></td>
    </tr>
    <tr>
      <td><span>2</span></td>
      <td>
        <span><a href="http://www.wnba.com/player/riquna-williams/" target="_blank">Riquna Williams</a></span></td>
      <td><span>G</span></td>
      <td><span>5-7</span></td>
      <td><span>165</span></td>
      <td><span>May 28, 1990</span></td>
      <td><span>5</span></td>
      <td><span>Miami (Fla.)</span></td>
    </tr>
  </tbody>
</table>
              
            
!

CSS

              
                table {
  max-width: 100%;
}

tr:nth-child(odd) {
  background-color: #eee;
}

th {
  background-color: #555;
  color: #fff;
}

th,
td {
  text-align: left;
  padding: 0.5em 1em;
}

td::before {
  display: none;
}

@media screen and (max-width: 680px) {
 table {
   border: 0;
   display: block;
   box-shadow: none;
 }

 thead {
   position: absolute;
   opacity: 0;
 }
  
 tbody {
   display: block;
   width: 100%;
   min-width: 19em;
   max-width: 25em;
 }

 tr {
   border-top: 2px solid #3c3c3b;
   border-bottom: 1px solid #3c3c3b;
   display: grid;
   grid-template-columns: max-content auto;
   margin-bottom: 1em;
 }

 td {
   display: contents;
 }

 td::before {
   display: inline-block;
   font-weight: bold;
   padding: 0.5em;
   border-bottom: 1px solid;
 }
  
  td span {
    padding: 0.5em;
    border-bottom: 1px solid;
  }

 td:last-child {
   border-bottom: 0;
 }
}
              
            
!

JS

              
                /* Function modified from Adrian Roselli's article, A Responsive Accessible Table, http://adrianroselli.com/2017/11/a-responsive-accessible-table.html
*/
function cellHeaders(tableId) {
  try {
    let thArray = [];
    const table = document.getElementById(tableId);
    const headers = table.getElementsByTagName('th');
    for (let i = 0; i < headers.length; i++) {
      const headingText = headers[i].innerHTML;
      thArray.push(headingText);
    }
    const styleElm = document.createElement('style');
    let styleSheet;
    document.head.appendChild(styleElm);
    styleSheet = styleElm.sheet;
    for (let i = 0; i < thArray.length; i++) {
      styleSheet.insertRule(
        '#' +
          tableId +
          ' td:nth-child(' +
          (i + 1) +
          ')::before {content:"' +
          thArray[i] +
          ': ";}',
        styleSheet.cssRules.length
      );
    }
  } catch (err) {
    console.log('cellHeaders(): ' + err);
  }
}
cellHeaders('respTable');

              
            
!
999px

Console