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

              
                <h1 class="text-center">Table made with divs, click to expand</h1>
<hr>
<div class="container">
  <div class="row">
    <div class="col-sm-offset-2 col-lg-9">
      <div class="col-lg-12">
      <div class="row faux-table-header">
        <div class="col-xs-3">
          <label for="row-1">Row 1</label>
        </div>
        <div class="col-xs-3">
          <label for="row-2">Row 2</label>
        </div>
        <div class="col-xs-3">
          <label for="row-3">Row 3</label>
        </div>
        <div class="col-xs-3">
          <label for="row-4">Row 4</label>
        </div>
      </div>
    </div>
    <div class="col-lg-12 show-info faux-table">
      <div class="row">
        <div class="col-xs-3">
          <p class="item">Item 1</p>
        </div>
        <div class="col-xs-3">
          <p class="item">Item 2</p>
        </div>
        <div class="col-xs-3">
          <p class="item">Item 3</p>
        </div>
        <div class="col-xs-3">
          <p class="item">Item 4</p>
        </div>
      </div>
            <div class="more-info"  style="display: none;">
        <div class="col-md-6">
          <div class="row">
            <div class="col-md-6">
              <label for="additional-info-1">Additional Info 1:</label>
              <p>This is more information</p>
            </div>
            <div class="col-md-6">
              <label for="additional-info-2">Additional Info 2:</label>
              <p>This is more information</p>
            </div>
          </div>
          <div class="row">
            <div class="col-lg-12">
              <label for="additional-info-3">Additional Info 3:</label>
              <p>This is more information that stretches across the bottom of both divs above.</p>
            </div>
          </div>
         </div> 
          <div class="col-md-6">
           <label for="right-side">Right Side:</label>
           <p>This is a whole other side for information.</p>
      </div>
   </div>
    </div>
    <div class="col-lg-12 show-info faux-table">
      <div class="row">
        <div class="col-xs-3">
          <p class="item">Item 1</p>
        </div>
        <div class="col-xs-3">
          <p class="item">Item 2</p>
        </div>
        <div class="col-xs-3">
          <p class="item">Item 3</p>
        </div>
        <div class="col-xs-3">
          <p class="item">Item 4</p>
        </div>
      </div>
      <div class="more-info"  style="display: none;">
        <div class="col-md-6">
          <div class="row">
            <div class="col-md-6">
              <label for="additional-info-1">Additional Info 1:</label>
              <p>This is more information</p>
            </div>
            <div class="col-md-6">
              <label for="additional-info-2">Additional Info 2:</label>
              <p>This is more information</p>
            </div>
          </div>
          <div class="row">
            <div class="col-lg-12">
              <label for="additional-info-3">Additional Info 3:</label>
              <p>This is more information that stretches across the bottom of both divs above.</p>
            </div>
          </div>
         </div> 

      <div class="col-md-6">
       <label for="right-side">Right Side:</label>
        <p>This is a whole other side for information.</p>
      </div>
      </div>
      </div>
      </div> 
  </div>
  <h1 class="text-center">Regular Table</h1>
<hr>
  <div class="row">
    <div class="col-sm-offset-2 col-sm-9">
   <table class="table table-striped">
    <thead>
      <th>Row 1</th>
      <th>Row 2</th>
      <th>Row 3</th>
      <th>Row 4</th>
    </thead>
    <tbody>
        <tr>
          <td>Item 1</td>
          <td>Item 2</td>
          <td>Item 3</td>
          <td>Item 4</td>
        </tr>
        <tr>
          <td>Item 1</td>
          <td>Item 2</td>
          <td>Item 3</td>
          <td>Item 4</td>
        </tr>
    </tbody>
  </table>
    </div>
  </div>
</div>

              
            
!

CSS

              
                .faux-table-header {
    border-bottom: 1px solid #dddddd;
}
.faux-table {
    border-top: 1px solid #EAE9E9;
}

.faux-table:nth-child(even) {
    background: #f9f9f9;
}

.payment-rows:nth-child(even) {
    background: #fcfcfc;
}

.align-amount {
    margin-left: 90px;
}

.more-info:nth-child(even) {
    background: #f9f9f9;
}
.item {
    margin-top: 7px;
}
              
            
!

JS

              
                $('.show-info').click( function() {
	$(this).find('.more-info').slideToggle('slow');
});
              
            
!
999px

Console