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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


  <button id='add'>Add</button>
  <button id='remove'>Remove</button>
    <tbody id='theTable'>
      <tr class='.pt-entry'><td>row<td></tr>
      <tr class='.pt-entry-1'><td>row<td></tr>
      <tr class='.pt-entry-2'><td>row<td></tr>
      <tr class='.pt-entry-3'><td>row<td></tr>




//Define your elements
  var table = document.getElementById('theTable'),  
// your parent element you are adding content to
      rows = table.querySelectorAll('tr'),
//initial rows for counting
      rowCount = rows.length,
//how many rows exist
      addedRow = document.createElement('tr'),
//create the new row
      addButton = document.getElementById('add'),
      removeButton = document.getElementById('remove');
//basic buttons for example

  function addRow(){
    var thisRow = addedRow.cloneNode(true);
//clone your created row
    thisRow.setAttribute('class','.pt-entry-' + rowCount);
//set the class to be class + the row count (will increment) 
    rowCount += 1;

    thisRow.innerHTML = '<td>row</td>';
//adding whatever, not necessary
//puts the row in to your parent


  function removeRow(){

    var items = table.querySelectorAll('tr');
//get the new list of rows
    if (rowCount > 1){
    table.removeChild(items[rowCount - 1]);
//remove the last item
    rowCount -= 1;


addButton.addEventListener('click', function(e){



  removeButton.addEventListener('click', function(e){