Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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

              
                .header
  .item
    h2 Id
  .item
    h2 First Name
  .item
    h2 Middle Name
  .item
    h2 Last Name
  .item
    h2 Address
  .item
    h2 City
  .item
    h2 State
  .item
    h2 Zip
.content
  
              
            
!

CSS

              
                .header
  display: grid
  text-align: center
  grid-template-columns: repeat(8, 1fr)
  border-top: 1px solid black
  border-bottom: 1px solid black
  .item
    border-left: 1px solid black
    border-right: 1px solid black
.content
  display: grid
  text-align: center
  grid-template-columns: repeat(8, 1fr)
  border-top: 1px solid black
  border-bottom: 1px solid black
  .item
    border: 1px solid black
    padding: 1em
    transition: background-color 1.2s
  .item:hover
    background-color: #ccc
    transition: background-color 1.2s
              
            
!

JS

              
                $(document).ready(() => {
  var contacts = [{
  "id": 1,
  "first_name": "Salvatore",
  "middle_name": "Jeanine",
  "last_name": "Jarmyn",
  "address": "404 Barnett Pass",
  "city": "Huangshanguan",
  "state": null,
  "zip": null
}, {
  "id": 2,
  "first_name": "Evelin",
  "middle_name": "Andie",
  "last_name": "Vedyashkin",
  "address": "4390 Oakridge Terrace",
  "city": "Jinping",
  "state": null,
  "zip": null
}, {
  "id": 3,
  "first_name": "Karrie",
  "middle_name": "Ambur",
  "last_name": "Avesque",
  "address": "066 Loeprich Drive",
  "city": "Partang",
  "state": null,
  "zip": null
}, {
  "id": 4,
  "first_name": "Noel",
  "middle_name": "Ellsworth",
  "last_name": "Pitone",
  "address": "82848 Prairie Rose Lane",
  "city": "Rustenburg",
  "state": null,
  "zip": "0390"
}, {
  "id": 5,
  "first_name": "Brien",
  "middle_name": "Annette",
  "last_name": "Ostick",
  "address": "7 Lakewood Gardens Hill",
  "city": "Tatarka",
  "state": null,
  "zip": "356235"
}, {
  "id": 6,
  "first_name": "Balduin",
  "middle_name": "Edmon",
  "last_name": "Collinson",
  "address": "95 Fallview Junction",
  "city": "Chyhyryn",
  "state": null,
  "zip": null
}, {
  "id": 7,
  "first_name": "Nealy",
  "middle_name": "Bendicty",
  "last_name": "Fearfull",
  "address": "03 Meadow Ridge Court",
  "city": "Río Colorado",
  "state": null,
  "zip": "8138"
}, {
  "id": 8,
  "first_name": "Issi",
  "middle_name": "Inglis",
  "last_name": "Hachard",
  "address": "5210 Hazelcrest Plaza",
  "city": "Tulung",
  "state": null,
  "zip": null
}, {
  "id": 9,
  "first_name": "Cal",
  "middle_name": "Jasmina",
  "last_name": "Pallent",
  "address": "88 Coleman Park",
  "city": "Miłakowo",
  "state": null,
  "zip": "14-310"
}, {
  "id": 10,
  "first_name": "Jasmine",
  "middle_name": "Van",
  "last_name": "Hefferon",
  "address": "95 Parkside Street",
  "city": "Krasnotur’insk",
  "state": null,
  "zip": "624449"
}, {
  "id": 11,
  "first_name": "Kizzee",
  "middle_name": "Rayner",
  "last_name": "Hamnett",
  "address": "524 Mayer Crossing",
  "city": "Sosnovka",
  "state": null,
  "zip": "216245"
}, {
  "id": 12,
  "first_name": "Bethany",
  "middle_name": "Bobinette",
  "last_name": "Elfleet",
  "address": "16 Erie Parkway",
  "city": "Kista",
  "state": "Stockholm",
  "zip": "164 45"
}, {
  "id": 13,
  "first_name": "Simon",
  "middle_name": "Victor",
  "last_name": "Bradforth",
  "address": "80 Anthes Road",
  "city": "Lin’an",
  "state": null,
  "zip": null
}, {
  "id": 14,
  "first_name": "Fran",
  "middle_name": "Bessie",
  "last_name": "Feyer",
  "address": "71978 Melvin Plaza",
  "city": "Libertad",
  "state": null,
  "zip": "9021"
}, {
  "id": 15,
  "first_name": "Dev",
  "middle_name": "Alastair",
  "last_name": "Probat",
  "address": "617 Crowley Trail",
  "city": "Ýpsonas",
  "state": null,
  "zip": null
}, {
  "id": 16,
  "first_name": "Colby",
  "middle_name": "Goddart",
  "last_name": "Bus",
  "address": "2 Nobel Road",
  "city": "Néa Mákri",
  "state": null,
  "zip": null
}, {
  "id": 17,
  "first_name": "Dinnie",
  "middle_name": "Rosemary",
  "last_name": "Hullock",
  "address": "7889 Goodland Circle",
  "city": "Kadupayung",
  "state": null,
  "zip": null
}, {
  "id": 18,
  "first_name": "Kasper",
  "middle_name": "Doe",
  "last_name": "Descroix",
  "address": "909 Nelson Junction",
  "city": "Jiepai",
  "state": null,
  "zip": null
}, {
  "id": 19,
  "first_name": "Hyacinthie",
  "middle_name": "Ragnar",
  "last_name": "Heeney",
  "address": "92 Armistice Lane",
  "city": "Zhaigang",
  "state": null,
  "zip": null
}, {
  "id": 20,
  "first_name": "Shannon",
  "middle_name": "Nils",
  "last_name": "Bristo",
  "address": "323 Goodland Park",
  "city": "Ciherang",
  "state": null,
  "zip": null
}];

  for(let c of contacts){
    $('.content').append(`
    <div class='item'>${c.id}</div>
    <div class='item'>${c.first_name}</div>
    <div class='item'>${c.middle_name}</div>
    <div class='item'>${c.last_name}</div>
    <div class='item'>${c.address}</div>
    <div class='item'>${c.city}</div>
    <div class='item'>${c.state}</div>
    <div class='item'>${c.zip}</div>
    `);
  }
});
              
            
!
999px

Console