cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <div class="container">
  <h1>Staff Members</h1>
  <div class="table-wrap">
    <table>
      <thead>
        <tr>
          <th scope="col" colspan="2">User</th>
          <th scope="col">Email Address</th>
          <th scope="col">Biography</th>
          <th scope="col">Actions</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td data-th="Avatar">
            <span class="avatar">
              <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3211/chimp-thinking.jpg">
            </span>
          </td>
          <td data-th="Name">
            <h2>Chris Mounsey</h2></td>
          <td data-th="Email">
            <a href="#">chris.mounsey@domain.com</a></td>
          <td data-th="Bio">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum a diam nec magna luctus consequat. Nunc elit dolor, faucibus at semper vitae, gravida ut elit.</p> <p>Integer rutrum commodo purus non gravida. Vestibulum dolor lorem, placerat quis adipiscing id, malesuada sit amet arcu.</p></td>
          <td data-th="Actions">
            <button type="button" data-icon="&#xf040;" class="ac-edit">Edit</button>
            <button type="button" data-icon="&#xf057;" class="ac-delete">Delete</button>
          </td>
        </tr>
        <tr>
          <td data-th="Avatar">
            <span class="avatar">
              <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3211/chimp-thinking.jpg">
            </span>
          </td>
          <td data-th="Name">
            <h2>James Chappell</h2></td>
          <td data-th="Email">
            <a href="#">james.chappell@domain.com</a></td>
          <td data-th="Bio">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
            <p>Vestibulum a diam nec magna luctus consequat. Nunc elit dolor, faucibus at semper vitae, gravida ut elit. Integer rutrum commodo purus non gravida.</p>
            <p>Vestibulum dolor lorem, placerat quis adipiscing id, malesuada sit amet arcu.</p></td>
          <td data-th="Actions">
            <button type="button" data-icon="&#xf040;" class="ac-edit">Edit</button>
            <button type="button" data-icon="&#xf057;" class="ac-delete">Delete</button>
          </td>
        </tr>
        <tr>
          <td data-th="Avatar">
            <span class="avatar">
              <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3211/chimp-thinking.jpg">
            </span>
          </td>
          <td data-th="Name">
            <h2>Nora Harris</h2></td>
          <td data-th="Email">
            <a href="#">nora.harris@domain.com</a></td>
          <td data-th="Bio">
            <p>orem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum a diam nec magna luctus consequat. Nunc elit dolor, faucibus at semper vitae, gravida ut elit. Integer rutrum commodo purus non gravida. Vestibulum dolor lorem, placerat quis adipiscing id, malesuada sit amet arcu.</p></td>
          <td data-th="Actions">
            <button type="button" data-icon="&#xf040;" class="ac-edit">Edit</button>
            <button type="button" data-icon="&#xf057;" class="ac-delete">Delete</button>
          </td>
        </tr>
        <tr>
          <td data-th="Avatar">
            <span class="avatar">
              <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3211/chimp-thinking.jpg">
            </span>
          </td>
          <td data-th="Name">
            <h2>Laszlo Gyulai</h2></td>
          <td data-th="Email">
            <a href="#">laszlo.gyulai@domain.com</a></td>
          <td data-th="Bio">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum a diam nec magna luctus consequat.</p>
            <p>Nunc elit dolor, faucibus at semper vitae, gravida ut elit. Integer rutrum commodo purus non gravida. Vestibulum dolor lorem, placerat quis adipiscing id, malesuada sit amet arcu.</p></td>
          <td data-th="Actions">
            <button type="button" data-icon="&#xf040;" class="ac-edit">Edit</button>
            <button type="button" data-icon="&#xf057;" class="ac-delete">Delete</button>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</div>
            
          
!
            
              table {
  border-collapse:collapse;
  table-layout:auto;
  position:relative;
  padding:1px;
  @media @mobile {
    border:none;
  }
	@media @tablet {
		display:flex;
		//flex-wrap:wrap;
	}
  tr {
    border:1px solid #aaa;
    @media @mobile {
      display:block;
      border:1px solid #ccc;
      padding:(@space-em * 2);
      margin-bottom:(@space-em * 2);
      background-color:#fff;
      background-image: linear-gradient(#fff, #ccc);
      box-shadow:0 2px 8px rgba(0,0,0,0.7), 0 1px 1px rgba(255,255,255,0.8);
      border-radius:4px;
    }
    @media @tablet {
      flex:0 0 80px;
			display:block;
      &:nth-of-type(odd) {
        //margin-right:1%;
      }
      &:nth-of-type(even) {
        //margin-left:1%;
      }
    }
  }
  thead {
    tr {
      th {
        font-size:90%;
        border:1px solid #bbb;
        text-align:left;
        background-color:#eee;
        background-image: linear-gradient(#eee, #ccc);
        padding:@space-em;
        text-shadow:0 1px 1px rgba(255,255,255,0.8);
      }
      @media @mobile {
        display:none;
      }
    }
  }
  td {
    padding:@space-em;
    border:1px solid #eee;
    border-bottom-color:#ddd;
    border-top-color:#ddd;
    vertical-align:top;
    display:table-cell;
    &:first-child {
      border-left-color:#ccc;
    }
    &:last-child {
      border-right-color:#ccc;
    }
    h2 {
      font-size:@base-font-size;
      margin:0;
      @media @mobile {
        font-size:24px;
        font-weight:400;
        margin:0;
        padding-top:@space-em;
      }
    }
    &[data-th="Email"] {
      @media @mobile {
        word-break:break-all;
      }
    }
    .avatar {
      display:inline-block;
      border-radius:50%;
      overflow:hidden;
      border:2px solid white;
      box-shadow:0 1px 4px rgba(0,0,0,0.6);
      width:64px;
      height:64px;
      margin:0 (@space-em * 2) 0 0;
      @media @mobile {
        width:3.2em;
        height:3.2em;
        margin:0;
      }
      img {
          width:100%;
          height:100%;
      }
    }
    @media @mobile {
      @label-width:4.5em;
      padding-left:(@label-width + 1em);
      display:block;
      border:none;
      &:before {
        content:attr(data-th)": ";
        display:inline-block;
        font-weight: bold;
        margin:0 0.1em 0 (-(@label-width + 1em));
        display: inline-block;
        float:left;
        width: @label-width;
        font-size: 90%;
      }
      &[data-th="Avatar"] {
        padding-left:@space-em;
        display:inline-block;
        &:before {
          content:"";
        }
      }
      &[data-th="Name"] {
        padding-left:0;
        display:inline-block;
        &:before {
          content:"";
        }
      }
    }    
  }
}

// Boring but important
body,
html {
  padding:0;
  margin:0;
  background:#ddd;
}

html {
  height:100%;
}

body {
  font-family:'Helvetica Neue','Helvetica',sans-serif;
  font-weight:200;
  color:#444;
  font-size:@base-font-size;
  line-height:1.3;
  padding:0 (@space-em * 4);
  min-height:100%;
  @media @mobile {
    padding:0;
    background:@blue;
  }
}

a {
  @link-col:@blue;
  color:@link-col;
  font-weight:400;
  &:hover {
    color:lighten(@link-col,20%);
    text-decoration:none;
  }
}

.container {
  margin:(@space-em * 2) auto;
  max-width:1170px;
  background:white;
  padding:(@space-em * 2);
  min-width:300px;
  box-shadow:0 2px 8px rgba(0,0,0,0.6);
  border-radius:4px;
  @media @mobile {
    background:@blue;
    margin:0;
    border-radius:0;
    padding:@space-em (@space-em * 2);
    box-shadow:none;
  }
  h1 {
    font-weight:100;
    margin:(@space-em / 2) 0 @space-em 0;
    @media @mobile {
      font-weight:100;
      color:white;
    }
  }
}

// Implement FontAwesome
// Font Awesome (better: more glyphs, more free-ness)
.fonticon {
	font-family:'FontAwesome';
	font-style:normal;
	font-weight:normal;
	line-height:1;
	-webkit-font-smoothing:antialiased;
	-moz-osx-font-smoothing:grayscale;
}

// Display icons automatically
[data-icon]:before {
  font-family:'FontAwesome';
  // BYO icon font, mapped smartly
  content: attr(data-icon)" ";
  speak: none; // Not to be trusted
  white-space:nowrap;
  &:extend(.fonticon);
}

p {
  margin:0 0 @space-em 0;
}

button {
  color:white;
  text-shadow:0 -1px 1px rgba(0,0,0,0.4);
  border-radius:2px;
  font-size:90%;
  display:block;
  width:100%;
  margin:0 0 @space-em 0;
  @media @mobile {
    display:inline-block;
    width:auto;
    padding:(@space-em * 3) (@space-em * 2);
    margin:0;
  }
  &.ac-edit {
    @btn-col:@blue;
    background-color:@btn-col;
    background-image: linear-gradient(lighten(@btn-col,20%), @btn-col);
    border:1px solid darken(@btn-col,5%);
    color:lighten(@btn-col,50%);
    &:hover {
      background:@btn-col;
      color:white;
    }
  }
  &.ac-delete {
    @btn-col:@red;
    background-color:@btn-col;
    background-image: linear-gradient(lighten(@btn-col,20%), @btn-col);
    border:1px solid darken(@btn-col,5%);
    color:lighten(@btn-col,50%);
    &:hover {
      background:@btn-col;
      color:white;
    }
  }
}

// Variables
@space-em:0.4em;
@base-font-size:14px;

// Colors
@blue:hsl(210,20%,30%);
@red:hsl(2,50%,30%);

* {
 box-sizing:border-box; 
}

// Media queries
@mobile:		~"only screen and (max-width: 50em)"; // Anything at Tablet size
@tablet:		~"only screen and (min-width: 37em) and (max-width: 50em)"; // Anything at Tablet size
            
          
!
999px
🕑 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 ..................

Console