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

              
                <table id="persontable">
  <thead>
    <tr>
      <td>First Name</td>
      <td>Last Name</td>
      <td>Address</td>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Bill</td>
      <td>Bob</td>
      <td>Already here</td>
    </tr>
  </tbody>
</table>

<template id="person">
  <tr>
    <td class="record"></td>
    <td></td>
    <td></td>
  </tr>
</template>

<template id="address">
    <td class="record"></td>
</template>
              
            
!

CSS

              
                
              
            
!

JS

              
                // Test to see if the browser supports the HTML template element by checking
// for the presence of the template element's content attribute.
if ('content' in document.createElement('template')) {

  // Instantiate the table with the existing HTML tbody and the row with the template
  var fullnameTemplate = document.querySelector('#person'),
  td = fullnameTemplate.content.querySelectorAll("td");
  td[0].textContent = "Peter";
  td[1].textContent = "O'Toole";
  td[2].textContent = "100 ABC Street";

  // Clone the new row and insert it into the table
  var tbody = document.getElementsByTagName("tbody");
  var clone = document.importNode(fullnameTemplate.content, true);
  tbody[0].appendChild(clone);
  
  // Create a new row
  td[0].textContent = "Dudley";
  td[1].textContent = "Moore";
  td[2].textContent = "999 Lala Street";

  // Clone the new row and insert it into the table
  var clone2 = document.importNode(fullnameTemplate.content, true);
  tbody[0].appendChild(clone2);

} else {
  // Find another way to add the rows to the table because 
  // the HTML template element is not supported.
}
              
            
!
999px

Console