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>Comparison Table using UL lists and CSS flexbox. Responsive and Easy to Customize.</h1>


<div class="comparisontable">

	<ul class="row">
		<li class="legend">Office Chairs</li>
		<li><img src="https://image.ibb.co/ksjS3y/Zenith_chair.jpg" /><br />Eurotech</li>
		<li><img src="https://image.ibb.co/ksjS3y/Zenith_chair.jpg" /><br />Hbada</li>
		<li><img src="https://image.ibb.co/ksjS3y/Zenith_chair.jpg" /><br />Zenith</li>
		<li><img src="https://image.ibb.co/ksjS3y/Zenith_chair.jpg" /><br />Amazonbasics</li>
	</ul>
	
	<ul class="row">
		<li class="legend">Weight</li>
		<li>25kg</li>
		<li>13kg</li>
		<li>17kg</li>
		<li>28kg</li>
	</ul>
	
	<ul class="row">
		<li class="legend">Cost</li>
		<li>$$</li>
		<li>$</li>
		<li>$$</li>
		<li>$</li>
	</ul>
	
	<ul class="row">
		<li class="legend">Delivery</li>
		<li>Domestic</li>
		<li>International</li>
		<li>International</li>
		<li>Domestic</li>
	</ul>
	
	<ul class="row">
		<li class="legend">Verdict</li>
		<li>Best Chair for Back Pain</li>
		<li>Best budget chair</li>
		<li>All Mesh for Cooling</li>
		<li>Only Chair with Top Grain Leather</li>
	</ul>
	
	<ul class="row">
		<li class="legend"></li>
		<li><a href="http://ergonomictrends.com/best-ergonomic-office-chairs-reviews-buyers-guide/" class="calltoaction" rel="nofollow">Buy Now</a></li>
		<li><a href="http://ergonomictrends.com/best-ergonomic-office-chairs-under-200-reviews/" class="calltoaction" rel="nofollow">Buy Now</a></li>
		<li><a href="http://ergonomictrends.com/best-ergonomic-office-chairs-under-300-reviews/" class="calltoaction" rel="nofollow">Buy Now</a></li>
		<li><a href="http://ergonomictrends.com/best-ergonomic-office-chairs-under-100-reviews/" class="calltoaction" rel="nofollow">Buy Now</a></li>
	</ul>

</div>
              
            
!

CSS

              
                div.comparisontable{
  display: flex;
  flex-direction: column;
}

div.comparisontable img{
  max-width: 100%;
  width: auto;
  height: auto;
}


div.comparisontable ul.row{
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  flex: 1;
  width: 100%;
  flex-wrap: wrap;
}

div.comparisontable ul.row li{
  background: #c9f4ca;
  flex: 1;
  padding: 10px;
  border-bottom: 1px solid gray;
}

div.comparisontable ul.row li.legend{
 	background: #6640d8;
  color: white;
  font-weight: bold;
  border: none;
  width: 200px;
  border-bottom: 1px solid white;
}

div.comparisontable ul.row li:last-of-type{
}

/* very first row */
div.comparisontable ul.row:first-of-type li{
  text-align: center;
}

/* very last row */
div.comparisontable ul.row:last-of-type li{
  text-align: center;
  border-bottom: none;
  box-shadow: 0 6px 6px rgba(0,0,0,0.23);
}

div.comparisontable a.calltoaction{
  color: white;
  background: #e12525;
  display: inline-block;
  padding: 8px 10px;
  text-decoration: none;
  border-radius: 8px;
  margin: .1em auto;
}

div.comparisontable a.calltoaction:hover{
  background: #d11212;
}


/* first and last cell within legend column */
div.comparisontable ul.row:first-of-type li.legend.legend,
div.comparisontable ul.row:last-of-type li.legend{
  background: transparent;
  box-shadow: none;
}

@media screen and (max-width:650px){
  
  div.comparisontable ul.row{
    flex-direction: column;
  }
  
  div.comparisontable img{
    width: auto;
    height: auto;
  }
  
  div.comparisontable ul.row li{
    margin-right: 0;
		flex: auto;
    width: auto;
  }
  
  /* first and last cell within legend column */
  div.comparisontable ul.row:first-of-type li.legend.legend,
  div.comparisontable ul.row:last-of-type li.legend{
    display: none;
  }
  
  div.comparisontable ul.row li.legend{
    width: auto;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console