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

              
                <main>
  <h1>Table Tests</h1>
  
  <h2>Vanilla Table</h2>
    <table>
      <caption>Books I May or May Not Have Read</caption>
      <tr>
        <th>Author</th>
        <th>Title</th>
        <th>Year</th>
        <th>ISBN-13</th>
        <th>ISBN-10</th>
      </tr>
      <tr>
        <td>Miguel De Cervantes</td>
        <td>The Ingenious Gentleman Don Quixote of La Mancha</td>
        <td>1605</td>
        <td>9783125798502</td>
        <td>3125798507</td>
      </tr>
      <tr>
        <td>Mary Shelley</td>
        <td>Frankenstein; or, The Modern Prometheus</td>
        <td>1818</td>
        <td>9781530278442</td>
        <td>1530278449</td>
      </tr>
      <tr>
        <td>Herman Melville</td>
        <td>Moby-Dick; or, The Whale</td>
        <td>1851</td>
        <td>9781530697908</td>
        <td>1530697905</td>
      </tr>
      <tr>
        <td>Emma Dorothy Eliza Nevitte Southworth</td>
        <td>The Hidden Hand</td>
        <td>1888</td>
        <td>9780813512969</td>
        <td>0813512964</td>
      </tr>
      <tr>
        <td>F. Scott Fitzgerald</td>
        <td>The Great Gatsby</td>
        <td>1925</td>
        <td>9780743273565</td>
        <td>0743273567</td>
      </tr>
      <tr>
        <td>George Orwell</td>
        <td>Nineteen Eighty-Four</td>
        <td>1948</td>
        <td>9780451524935</td>
        <td>0451524934</td>
      </tr>
    </table>
  
  
  <h2><code>colindex</code> and <code>rowindex</code> on the first data cell</h2>
    <table>
      <caption>Books I May or May Not Have Read</caption>
      <tr>
        <th>Author</th>
        <th>Title</th>
        <th>Year</th>
        <th>ISBN-13</th>
        <th>ISBN-10</th>
      </tr>
      <tr>
        <td colindex="0" rowindex="1">Miguel De Cervantes</td>
        <td>The Ingenious Gentleman Don Quixote of La Mancha</td>
        <td>1605</td>
        <td>9783125798502</td>
        <td>3125798507</td>
      </tr>
      <tr>
        <td>Mary Shelley</td>
        <td>Frankenstein; or, The Modern Prometheus</td>
        <td>1818</td>
        <td>9781530278442</td>
        <td>1530278449</td>
      </tr>
      <tr>
        <td>Herman Melville</td>
        <td>Moby-Dick; or, The Whale</td>
        <td>1851</td>
        <td>9781530697908</td>
        <td>1530697905</td>
      </tr>
      <tr>
        <td>Emma Dorothy Eliza Nevitte Southworth</td>
        <td>The Hidden Hand</td>
        <td>1888</td>
        <td>9780813512969</td>
        <td>0813512964</td>
      </tr>
      <tr>
        <td>F. Scott Fitzgerald</td>
        <td>The Great Gatsby</td>
        <td>1925</td>
        <td>9780743273565</td>
        <td>0743273567</td>
      </tr>
      <tr>
        <td>George Orwell</td>
        <td>Nineteen Eighty-Four</td>
        <td>1948</td>
        <td>9780451524935</td>
        <td>0451524934</td>
      </tr>
    </table>
  
  
  <h2><code>colindex</code> only on the first data cell</h2>
    <table>
      <caption>Books I May or May Not Have Read</caption>
      <tr>
        <th>Author</th>
        <th>Title</th>
        <th>Year</th>
        <th>ISBN-13</th>
        <th>ISBN-10</th>
      </tr>
      <tr>
        <td colindex="0">Miguel De Cervantes</td>
        <td>The Ingenious Gentleman Don Quixote of La Mancha</td>
        <td>1605</td>
        <td>9783125798502</td>
        <td>3125798507</td>
      </tr>
      <tr>
        <td>Mary Shelley</td>
        <td>Frankenstein; or, The Modern Prometheus</td>
        <td>1818</td>
        <td>9781530278442</td>
        <td>1530278449</td>
      </tr>
      <tr>
        <td>Herman Melville</td>
        <td>Moby-Dick; or, The Whale</td>
        <td>1851</td>
        <td>9781530697908</td>
        <td>1530697905</td>
      </tr>
      <tr>
        <td>Emma Dorothy Eliza Nevitte Southworth</td>
        <td>The Hidden Hand</td>
        <td>1888</td>
        <td>9780813512969</td>
        <td>0813512964</td>
      </tr>
      <tr>
        <td>F. Scott Fitzgerald</td>
        <td>The Great Gatsby</td>
        <td>1925</td>
        <td>9780743273565</td>
        <td>0743273567</td>
      </tr>
      <tr>
        <td>George Orwell</td>
        <td>Nineteen Eighty-Four</td>
        <td>1948</td>
        <td>9780451524935</td>
        <td>0451524934</td>
      </tr>
    </table>
  
  
  <h2><code>rowindex</code> only on the first data cell</h2>
    <table>
      <caption>Books I May or May Not Have Read</caption>
      <tr>
        <th>Author</th>
        <th>Title</th>
        <th>Year</th>
        <th>ISBN-13</th>
        <th>ISBN-10</th>
      </tr>
      <tr>
        <td rowindex="1">Miguel De Cervantes</td>
        <td>The Ingenious Gentleman Don Quixote of La Mancha</td>
        <td>1605</td>
        <td>9783125798502</td>
        <td>3125798507</td>
      </tr>
      <tr>
        <td>Mary Shelley</td>
        <td>Frankenstein; or, The Modern Prometheus</td>
        <td>1818</td>
        <td>9781530278442</td>
        <td>1530278449</td>
      </tr>
      <tr>
        <td>Herman Melville</td>
        <td>Moby-Dick; or, The Whale</td>
        <td>1851</td>
        <td>9781530697908</td>
        <td>1530697905</td>
      </tr>
      <tr>
        <td>Emma Dorothy Eliza Nevitte Southworth</td>
        <td>The Hidden Hand</td>
        <td>1888</td>
        <td>9780813512969</td>
        <td>0813512964</td>
      </tr>
      <tr>
        <td>F. Scott Fitzgerald</td>
        <td>The Great Gatsby</td>
        <td>1925</td>
        <td>9780743273565</td>
        <td>0743273567</td>
      </tr>
      <tr>
        <td>George Orwell</td>
        <td>Nineteen Eighty-Four</td>
        <td>1948</td>
        <td>9780451524935</td>
        <td>0451524934</td>
      </tr>
    </table>
  
  
  
  
  <h2><code>colindex</code> and <code>rowindex</code> on the first data cell, which has <code>role=cell</code></h2>
    <table>
      <caption>Books I May or May Not Have Read</caption>
      <tr>
        <th>Author</th>
        <th>Title</th>
        <th>Year</th>
        <th>ISBN-13</th>
        <th>ISBN-10</th>
      </tr>
      <tr>
        <td colindex="0" rowindex="1" role="cell">Miguel De Cervantes</td>
        <td>The Ingenious Gentleman Don Quixote of La Mancha</td>
        <td>1605</td>
        <td>9783125798502</td>
        <td>3125798507</td>
      </tr>
      <tr>
        <td>Mary Shelley</td>
        <td>Frankenstein; or, The Modern Prometheus</td>
        <td>1818</td>
        <td>9781530278442</td>
        <td>1530278449</td>
      </tr>
      <tr>
        <td>Herman Melville</td>
        <td>Moby-Dick; or, The Whale</td>
        <td>1851</td>
        <td>9781530697908</td>
        <td>1530697905</td>
      </tr>
      <tr>
        <td>Emma Dorothy Eliza Nevitte Southworth</td>
        <td>The Hidden Hand</td>
        <td>1888</td>
        <td>9780813512969</td>
        <td>0813512964</td>
      </tr>
      <tr>
        <td>F. Scott Fitzgerald</td>
        <td>The Great Gatsby</td>
        <td>1925</td>
        <td>9780743273565</td>
        <td>0743273567</td>
      </tr>
      <tr>
        <td>George Orwell</td>
        <td>Nineteen Eighty-Four</td>
        <td>1948</td>
        <td>9780451524935</td>
        <td>0451524934</td>
      </tr>
    </table>
</main>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Lato:400,700);

body {
  background-color: #6D695C;
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAACVBMVEUAAAAAAAAAAACDY+nAAAAAA3RSTlMmDQBzGIDBAAAAG0lEQVR42uXIIQEAAADCMHj/0NdkQMws0HEeAqvwAUGJthrXAAAAAElFTkSuQmCC);
  font-size: 100%;
  color: #333;
  font-family: Lato, Arial, sans-serif;
  padding: 0;
  margin: 0;
}

main {
  display: block;
  box-sizing: border-box;
  width: 90%;
  margin: 1em auto;
  padding: 1em 2em;
  color: #000;
  background-color: rgba(204,204,204,.7);
  border: .07em solid rgba(0,0,0,.5);
  border-radius: .5em;
}

table {
  margin: 1em 0;
  border-collapse: collapse;
}

caption {
  text-align: left;
  font-style: italic;
  padding: 0.25em 0.5em 0.5em 0.5em;
}

th,
td {
  padding: 0.25em 0.5em 0.25em 1em;
  vertical-align: text-top;
  text-align: left;
  text-indent: -0.5em;
}

th {
  vertical-align: bottom;
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-weight: bold;
}

tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.25);
}

tr:nth-child(odd) {
  background-color: rgba(255, 255, 255, 0.5);
}

td:nth-of-type(2) {
  font-style: italic;
}

th:nth-of-type(3),
td:nth-of-type(3) {
  text-align: right;
}

              
            
!

JS

              
                
              
            
!
999px

Console