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.



Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO


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.


Make Template?

Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.

Template URL

Any Pen can act as a template (even if you don't flip the toggle above) with a special URL you can use yourself or share with others. Here's this Pen's template URL:


Screenshot or Custom Thumbnail

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO


                <div class="container" ng-app="myApp">
   <div  ng-controller="ctrl">
      <div class="panel panel-default data-table">
         <div class="panel-heading">
            <ul class="nav nav-pills">
               <li role="presentation" ng-class="{'active': targetTable == t}" ng-repeat="t in tables"><a href="#" ng-click="select(t)">{{}}</a></li>
               <li><a href="#" ng-click="select(t)">+ Add Table</a></li>
         <div class="panel-body">
            <table class="table table-bordered">
                  <col class="unique-id">
                     <th class="unique-id">ID #</th>
                     <th contenteditable="true" ng-repeat="c in targetTable.columns" ng-model="c.label"></th>
                     <th class="view-next-set"><a href="#">...</a></th>
                     <td class="center add-column"><a href="#" ng-click="addColumn()">+ Add Column</a></td>
                  <tr ng-repeat="r in targetTable.rows">
                     <td class="unique-id">{{}}</td>
                     <td contenteditable="true" ng-repeat="column in targetTable.columns" ng-model="r[]" ng-blur="! addNewRow(r[], r): undefined"></td>
                     <td class="blank" colspan="2"></td>
                     <td class="unique-id"></td>
                     <td contenteditable="true" ng-repeat="column in targetTable.columns" ng-model="entry" ng-blur="addRow(entry,"></td>
                     <td class="blank" colspan="2"></td>
                  </tr> -->
     <div class="well well-sm"><code>{{read()}}</code></div>


                body { margin:60px 0px; }

.data-table .nav-pills li { text-transform: capitalize; }
.nav.nav-pills li span { padding: 20px; }
.table .unique-id { width: 10px !important; text-align: center; background-color:#f5f5f5; }
.table td, .table th { width: 120px; }
.table .center { text-align: center; }
.table th.font-normal { font-weight: normal; }
.table .view-next-set { width:5px; text-align:center; font-size:0.9em; }
.table .add-column { width:60px; font-size:1em; vertical-align: middle; }

.table .unique-id, .table td.blank { background-color:#f5f5f5; }


                // Define the `ReportsMockUpsApp` module
angular.module('customControl', ['ngSanitize']).
directive('contenteditable', ['$sce', function($sce) {
  return {
    restrict: 'A', // only activate on element attribute
    require: '?ngModel', // get a hold of NgModelController
    link: function(scope, element, attrs, ngModel) {
      var disable = (attrs.contenteditable === "false") || !Boolean(attrs.contenteditable);
      if (!ngModel || disable) return; // do nothing if no ng-model
      // Write data to the model
      var read = function(value) {
        var html = element.html() || (typeof value === "string"? value: "");
        // When we clear the content editable the browser leaves a <br> behind
        // If strip-br attribute is provided then we strip this out
        if ( attrs.stripBr && html == '<br>' ) { html = ''; }

      // Specify how UI should be updated
      ngModel.$render = function() {
        element.html($sce.getTrustedHtml(ngModel.$viewValue || ''));

      // Listen for change events to enable binding
      element.on('blur keyup change', function() {
        read(ngModel.$modelValue); // initialize

var app = angular.module('myApp', ['customControl']);

// Define the `appController` controller on the `ReportsMockUpsApp` module
app.controller('ctrl', function($scope) {
   var table =  {
     id: 0,
     name: "table 14",
     columns: [{id: 0, label:"Name"}, {id: 1, label:"Age"}],
     rows: [{"0": "Mark Smith", "1": 10, id: 1035}, {"0": "Mathew Coley", "1": 54, id: 1036}, {}],
     uniqueIdCounter: 1037
   $scope.tables = [table];  
   $scope.targetTable = $scope.tables[0];
  $ = function(tbl) {
    $scope.selectedTable = tbl;
  $scope.addColumn = function() {
    var columns = $scope.targetTable.columns, id = columns.length;
      id: columns.length, 
      label: `Column ${id}`

  $scope.addNewRow = function(value, row) { 
    if(!value || value === "" || typeof value !== 'string') return;
    debugger; = $scope.targetTable.uniqueIdCounter++;
   /*$scope.addRow = function(value, column) {    
    if(!value || value === "" || typeof value !== 'string') return;
    else if(column === "") return;
    // create new row
    var row = { id: 2000 };
    row[column] = value;
    // clear last row cell..
    this.entry = "";   
  /*$scope.viewColumns = function(start, end) {
    var columns = [];
    for (var i = min; i <= max; i ++) {
    return input;
  $ = function(){
    return JSON.stringify(table);

Save your sass for CSS. Everywhere else be kind.