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 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

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

              
                <h1>jquery-rsLiteGrid plugin demo</h1>
<table></table>
  
<button>Export to Json</button>
<p>
  Type some data and press Enter. Use your arrows keys, Tab or Shift+Tab to focus on each cell.
</p>
<p>
  If the last row is changed, a new one is automatically appended.
</p>

<a href="https://codepen.io/ruisoftware/pen/zozVOo" target="_blank"><mark>Click here</mark></a> for a styled version
<a class="github" href="https://github.com/ruisoftware/jquery-rsLiteGrid" target="github">More on GitHub</a>
              
            
!

CSS

              
                a.github {
  display: block;
  margin-top: 2em;
}
              
            
!

JS

              
                      $('table').rsLiteGrid({
        caption: 'Table caption',

        cols: [{
          name: 'name',
          header: 'Name'
        }, {
          name: 'gender',
          header: 'Gender',
          markup: '<select><option value="male">Male</option><option value="female">Female</option></select>',
          defaultValue: 'male'
        }, {
          name: 'age',
          header: 'Age',
          markup: '<input type="number">'
        }, {
          name: 'rule',
          header: 'Rule'
        }, {
          // Delete button needs no name, since this columns does not need to be exported to Json
          markup: '<button title="delete this row">X</button>',
          tabStop: false
        }],

        // event fired after each row is appended to the table.
        // The right place to set the click event for the delete row button
        onAddRow: function (event, $lastNewRow) {
          $('button', $lastNewRow).click(function () {
            $('table').rsLiteGrid('delRow', $lastNewRow);
          });
        }

        // load table with 2 rows of data
      }).rsLiteGrid('setData', [
        { name: 'John', rule: 'Developer', age: 43 },
        { name: 'Maria', gender: 'female' }
      ]);

      // export data
      $('table + button').click(function () {
        console.log($('table').rsLiteGrid('getData'));
        alert('Open your browser console to see the Json data.');
      });

              
            
!
999px

Console