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


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


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.


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.


                <h1>Responstable <span>1.0</span> by <span>jordyvanraaij</span></h1>

<table class="responstable">
    <th>Main driver</th>
    <th>First name</th>
    <th>Date of birth</th>
    <td data-th="Main driver"><input type="radio"/></td>
    <td data-th="First name">Steve</td>
    <td data-th="Surname">Foo</td>
    <td data-th="Date of birth">01/01/1978</td>
    <td data-th="Relationship">Policyholder</td>
    <td data-th="Main driver"><input type="radio"/></td>
    <td data-th="First name">Steffie</td>
    <td data-th="Surname">Foo</td>
    <td data-th="Date of birth">01/01/1978</td>
    <td data-th="Relationship">Spouse</td>
    <td data-th="Main driver"><input type="radio"/></td>
    <td data-th="First name">Stan</td>
    <td data-th="Surname">Foo</td>
    <td data-th="Date of birth">01/01/1994</td>
    <td data-th="Relationship">Son</td>
    <td data-th="Main driver"><input type="radio"/></td>
    <td data-th="First name">Stella</td>
    <td data-th="Surname">Foo</td>
    <td data-th="Date of birth">01/01/1992</td>
    <td data-th="Relationship">Daughter</td>


                @import "compass/css3";


RESPONSTABLE 1.0 by jordyvanraaij
  Designed mobile first!

If you like this solution, you might also want to check out the 2.0 version:


// Default options for table style
$table-breakpoint: 480px;
$table-background-color: #FFF;
$table-text-color: #024457;
$table-outer-border: 1px solid #167F92;
$table-cell-border: 1px solid #D9E4E6;

// Extra options for table style (parse these arguments when including your mixin)
$table-border-radius: 10px;
$table-highlight-color: #EAF3F3;
$table-header-background-color: #167F92;
$table-header-text-color: #FFF;
$table-header-border: 1px solid #FFF;

// The Responstable mixin

@mixin responstable(
  $breakpoint: $table-breakpoint,
  $background-color: $table-background-color,
  $text-color: $table-text-color,
  $outer-border: $table-outer-border,
  $cell-border: $table-cell-border,
  $border-radius: none,
  $highlight-color: none,
  $header-background-color: $table-background-color,
  $header-text-color: $table-text-color,
  $header-border: $table-cell-border) {

  .responstable {
    margin: 1em 0;
    width: 100%;
    background: $background-color;
    color: $text-color;
    border-radius: $border-radius;
    border: $outer-border;
    overflow: hidden;
    tr {
      border-top: $outer-border;
      border-bottom: $outer-border;
      &:nth-child(odd) {  
        background-color: $highlight-color;
    th {
      display: none; // hide the table headers for mobile
      border: $header-border;
      background-color: $header-background-color;
      color: $header-text-color;
    td {
      display: block; // display the table as a block element for mobile   
      &:first-child {
        padding-top: .5em;
      &:last-child {
        padding-bottom: .5em;
      &:before {
        content: attr(data-th)": "; // grab the headers from the data-th and put them before every table cell for mobile
        font-weight: bold;
        width: 8em;
        display: inline-block;       
        @media (min-width: $breakpoint) {
          display: none; // do not display the data-th for desktop
      @media (min-width: $breakpoint) {
        border: $cell-border;
    th, td {
      text-align: left;
      margin: .5em 1em;  
      @media (min-width: $breakpoint) {
        display: table-cell; // turn the table into a 'normal' table-cell for desktop
        padding: 1em;
        &:first-child {
          text-align: center;

// Include the mixin (with extra options as overrides)

@include responstable(
  $border-radius: $table-border-radius,
  $highlight-color: $table-highlight-color,
  $header-background-color: $table-header-background-color,
  $header-text-color: $table-header-text-color,
  $header-border: $table-header-border);

// General styles

body {
  padding: 0 2em;
  font-family: Arial, sans-serif;
  color: #024457;
  background: #f2f2f2;

h1 {
  font-family: Verdana;
  font-weight: normal;
  color: #024457;
  span {color: #167F92;}