Using flexbox to create table like layout - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Layout

Description

Using flexbox to create table like layout

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

.box {<!--   www .  j  a va2  s .  co m-->
   outline: 1px solid red;
   width: 1000px;
   height: 450px;
   display: -webkit-flexbox;
   display: -ms-flexbox;
   display: -webkit-flex;
   -webkit-flex-flow: column wrap;
   -ms-flex-flow: column wrap;
   flex-flow: column wrap;
   -webkit-flex-pack: justify;
   -ms-flex-pack: justify;
   -webkit-justify-content: space-between;
   justify-content: space-between;
}
@supports (display: flex) and (flex-wrap: wrap) {
   .box {
      display: flex;
   }
}
.boxitem {
   width: 150px;
   height: 200px;
   background: #ccc;
}


      </style> 
 </head> 
 <body> 
  <div class="box"> 
   <div id="box1" class="boxitem">
     flexbox item 1 
   </div> 
   <div id="box2" class="boxitem">
     flexbox item 2 
   </div> 
   <div id="box3" class="boxitem">
     flexbox item 3 
   </div> 
   <div id="box4" class="boxitem">
     flexbox item 4 
   </div> 
   <div id="box5" class="boxitem">
     flexbox item 5 
   </div> 
   <div id="box6" class="boxitem">
     flexbox item 6 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials