css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

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.

              <div class="docs">

<h3>Selectively displaying data</h3>

<p>The number of columns displayed in the table below depends on the available screen space, by default; a smartphone will display 2 columns, for example, while an expanded desktop browser displays the full set.  This is accomplished by assigning semantic classes to the column headings that indicate which data values take precedence (essential vs optional), in combination with media queries to display them at different screen widths (a.k.a., <a href="http://www.alistapart.com/articles/responsive-web-design/">responsive design</a>).</p>

<p>We added a bit of JavaScript logic so you can control which data is displayed by checking column names in the "Display" menu on the right.  Once an option is checked, the associated data will persist and display at all screen widths until the option is unchecked.</p>

<p>You can also set a column to always persist by assigning a class in the markup, in which case it has no menu option.  Here, the "Company" column is persistent.</p>


<div class="table-wrapper">

<table cellspacing="0" id="tech-companies">
         <th class="persist essential">Company</th>
         <th class="essential">Last Trade</th>
         <th class="optional">Trade Time</th>
         <th class="essential">Change</th>
         <th class="optional">Prev Close</th>
         <th class="optional">Open</th>
         <th>1y Target Est</th>
         <th>GOOG <span class="co-name">Google Inc.</span></th>
         <td>14.81 (2.54%)</td>
         <td>597.73 x 100</td>
         <td>597.91 x 300</td>
         <th>AAPL <span class="co-name">Apple Inc.</span></th>
         <td>5.74 (1.54%)</td>
         <td>378.92 x 300</td>
         <td>378.99 x 100</td>
         <th>AMZN <span class="co-name">Amazon.com Inc.</span></th>
         <td>3.16 (1.68%)</td>
         <td>191.52 x 300</td>
         <td>191.58 x 100</td>
         <th>ORCL <span class="co-name">Oracle Corporation</span></th>
         <td>1.41 (4.72%)</td>
         <td>31.14 x 6500</td>
         <td>31.15 x 3200</td>
         <th>MSFT <span class="co-name">Microsoft Corporation</span></th>
         <td>0.66 (2.67%)</td>
         <td>25.50 x 71100</td>
         <td>25.51 x 17800</td>
         <th>CSCO <span class="co-name">Cisco Systems, Inc.</span></th>
         <td>0.97 (5.49%)</td>
         <td>18.65 x 10300</td>
         <td>18.66 x 24000</td>
         <th>YHOO <span class="co-name">Yahoo! Inc.</span></th>
         <td>0.11 (0.67%)</td>
         <td>15.79 x 6100</td>
         <td>15.80 x 17000</td>

              /* Styles for the tables test page */

/* Test page styles */
.docs {
   margin: 3% 5%;
   font-size: 1.2em;
.docs h3 {
   font-size: 1.2em;
   font-weight: bold;
   margin: .5em 0;
.docs p {
   margin: 0 0 1em;

body {
   font: 62.5%/1.3 Helvetica, sans-serif;
.a11y-only {
   position: absolute;
   left: -999em;

.table-wrapper {
   position: relative;
   margin: 5em 5%;
.table-menu-wrapper {
   position: absolute;
   top: -3em;
   right: 0;
.table-menu {
   position: absolute;
   background-color: #fff;
   padding: 10px;
   border: 1px solid #ccc;
   font-size: 1.2em;
   width: 12em;
   right: 0;
   left: auto;
.table-menu-hidden {
   left: -999em;
   right: auto;
.table-menu-btn {
   text-decoration: none;
   color: #333;
   font-size: 1.2em;
   background: #eee url(../_img/icon-menu.png) no-repeat 5px center;
   padding: .3em 10px .3em 20px;
   border: 1px solid #ccc;
.table-menu li {
   padding: .3em 0;

/* Table styles */
table {
	width: 100%;
	font-size: 1.2em;
thead th {
	white-space: nowrap;
	border-bottom: 1px solid #ccc;
	color: #888;
th, td {
   padding: .5em 1em;
	background-color: #fff;
	text-align: right;
td:first-child {
   text-align: left;
tbody th, td {
	border-bottom: 1px solid #e6e6e6;
.co-name {
   display: block;
   font-size: .9em;
   opacity: .4;

.enhanced th,
.enhanced td {
   display: none;

.legacy-ie .enhanced th.essential, 
.legacy-ie .enhanced td.essential {
	display: inline;
.enhanced th.essential, 
.enhanced td.essential {
   display: table-cell;

@media screen and (min-width: 500px) {
	.legacy-ie .enhanced th.optional, 
	.legacy-ie .enhanced td.optional {
		display: inline;
	.enhanced th.optional, 
	.enhanced td.optional {
		display: table-cell;

@media screen and (min-width: 800px) {
   .legacy-ie .enhanced th, 
   .legacy-ie .enhanced td {
      display: inline;
   .enhanced th, 
   .enhanced td {
      display: table-cell;
              /* Scripts for the tables test page 
   Author: Maggie Wachs, www.filamentgroup.com
   Date: November 2011
   Dependencies: jQuery, jQuery UI widget factory

(function( $ ) {
  $.widget( "filament.table", { // need to come up with a better namespace var...
    options: { 
      idprefix: null,   // specify a prefix for the id/headers values
      persist: null, // specify a class assigned to column headers (th) that should always be present; the script not create a checkbox for these columns
      checkContainer: null // container element where the hide/show checkboxes will be inserted; if none specified, the script creates a menu
    // Set up the widget
    _create: function() {
      var self = this,
            o = self.options,
            table = self.element,
            thead = table.find("thead"),
            tbody = table.find("tbody"),
            hdrCols = thead.find("th"),
            bodyRows = tbody.find("tr"),
            container = o.checkContainer ? $(o.checkContainer) : $('<div class="table-menu table-menu-hidden"><ul /></div>');         
      // add class for scoping styles - cells should be hidden only when JS is on
         var th = $(this),
               id = th.attr("id"), 
               classes = th.attr("class");
         // assign an id to each header, if none is in the markup
         if (!id) {
            id = ( o.idprefix ? o.idprefix : "col-" ) + i;
            th.attr("id", id);
         // assign matching "headers" attributes to the associated cells
         // TEMP - needs to be edited to accommodate colspans
            var cell = $(this).find("th, td").eq(i);                        
            cell.attr("headers", id);
            if (classes) { cell.addClass(classes); };
         // create the hide/show toggles
         if ( !th.is("." + o.persist) ) {
	         var toggle = $('<li><input type="checkbox" name="toggle-cols" id="toggle-col-'+i+'" value="'+id+'" /> <label for="toggle-col-'+i+'">'+th.text()+'</label></li>');
	               var input = $(this), 
	                  val = input.val(), 
	                  cols = $("#" + val + ", [headers="+ val +"]");
	               if (input.is(":checked")) { cols.show(); }
	               else { cols.hide(); };		
	            .bind("updateCheck", function(){
	               if ( th.css("display") == "table-cell" || th.css("display") == "inline" ) {
	                  $(this).attr("checked", true);
	               else {
	                  $(this).attr("checked", false);
      }); // end hdrCols loop 
      // update the inputs' checked status
      $(window).bind("orientationchange resize", function(){
      // if no container specified for the checkboxes, create a "Display" menu      
      if (!o.checkContainer) {
         var menuWrapper = $('<div class="table-menu-wrapper" />'),
               menuBtn = $('<a href="#" class="table-menu-btn">Display</a>');
            return false;
         // assign click-to-close event
				if ( !$(e.target).is( container ) && !$(e.target).is( container.find("*") ) ) {			
   }, // end _create
   disable: function() {
		// TBD

	enable: function() {
		// TBD
}( jQuery ) );

$(function(){ // on DOM ready

      idprefix: "co-",
      persist: "persist"

});  // end DOM ready
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................