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

              
                <h2 id="tableclasses">Standard Data Table</h2>
<p id="version">Last updated in <a href="https://cdn.watermarkinsights.com/css/1.1.3/wm-global.css" target="blank">1.1.3</a></p>
<p>To style a standard data table, create a well-structured table with <code>thead</code> and <code>tbody</code> elements. Specific classes for cetrtain elements are required, as shown below.</p>
<table aria-labelledby="tableclasses" class="data-table">
  <thead>
    <tr>
      <th scope="col" class="dataheadercell">Element</th>
      <th scope="col" class="dataheadercell">Required Class Names</th>
      <th scope="col" class="dataheadercell">Required Attributes</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td class="datacell" data-th="Element">table</td>
      <td class="datacell" data-th="Classes">data-table</td>
      <td class="datacell" data-th="Attributes"></td>
    </tr>
    <tr>
      <td class="datacell" data-th="Element">th</td>
      <td class="datacell" data-th="Classes">dataheadercell</td>
      <td class="datacell" data-th="Attributes"></td>
    </tr>
    <tr>
      <td class="datacell" data-th="Element">td</td>
      <td class="datacell" data-th="Classes">datacell</td>
      <td class="datacell" data-th="Attributes">data-th: The text to be used for the column title on small screens (generally exactly the same as the th).</td>
    </tr>
  </tbody>
</table>
<p class="info">On smaller screens, most data tables have columns that become too narrow to properly show all the information. The standard data-table will convert the column headers to row headers using the data-th attribute provided.</p>

<h2 id="tableclasses">Table in a Card</h2>
<p>Cards handle tables by stretching them to fit within the card without removing the default side padding.</p>
<div class="paper-card -nobottompadding">
  <div class="header">
    <h3 class="title">A card that contains a table</h3>
  </div>
  <div class="body">
    <table aria-labelledby="tableclasses" class="data-table">
      <thead>
        <tr>
          <th scope="col" class="dataheadercell">Lorem</th>
          <th scope="col" class="dataheadercell">Ipsum Dolor Sit</th>
          <th scope="col" class="dataheadercell">Amet</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td class="datacell" data-th="Lorem">consectetur </td>
          <td class="datacell" data-th="Ipsum Dolor Sit">Adipiscing elit</td>
          <td class="datacell" data-th="Amet">Sed interdum faucibus commodo. </td>
        </tr>
        <tr>
          <td class="datacell" data-th="Lorem">Integer</td>
          <td class="datacell" data-th="Ipsum Dolor Sit">Imperdiet</td>
          <td class="datacell" data-th="Amet">Lorem sit amet orci cursus, id tincidunt elit suscipit. </td>
        </tr>
        <tr>
          <td class="datacell" data-th="Lorem">Duis venenatis</td>
          <td class="datacell" data-th="Ipsum Dolor Sit">Erat magna</td>
          <td class="datacell" data-th="Amet">Sit amet ornare nisi elementum eget. Aenean non feugiat turpis. Sed in cursus urna. Praesent eu sem ligula. Curabitur ac nunc sollicitudin, interdum justo nec, tristique diam.</td>
        </tr>
      </tbody>
    </table>
  </div>
</div>

<h2 id="variantclasseshdr">Variations</h2>
<p>Common variations to the appearance of the data tables may be created by the application of certain variant classes as shown below:</p>
<table id="variantclasses" aria-labelledby="variantclasseshdr" class="data-table">
  <thead>
    <tr>
      <th scope="col" class="dataheadercell">Class Name</th>
      <th scope="col" class="dataheadercell">Element Applied To</th>
      <th scope="col" class="dataheadercell">Effect</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td class="datacell" data-th="Class Name">-centeraligned</td>
      <td class="datacell" data-th="Element">table</td>
      <td class="datacell" data-th="Effect">Vertically centers the text in the header and body cells of the table.</td>
    </tr>
    <tr>
      <td class="datacell" data-th="Class Name">-editable</td>
      <td class="datacell" data-th="Element">table</td>
      <td class="datacell" data-th="Effect">Adds vertical borders to the table cell. So named because this is usually only done when the table allows for inline editing.</td>
    </tr>
  </tbody>
</table>
              
            
!

CSS

              
                html, body {
  height: auto;
}
body {
  padding: 0 20px 40px;
  font-size: 14px;
}
h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 0;
  
  &:not(:first-of-type) {
    margin-top: 32px;
  }
  
  + p {
    margin-top: 0;
  }
}
#variantclasses td:first-child {
  white-space:nowrap;
}
.info {
  font-style: italic;
}
#version {
  font-style: italic;
}
              
            
!

JS

              
                
              
            
!
999px

Console