Pen Settings



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


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.


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.


      %td Tanaka
      %td 38
      %td Ikeda
      %td 4
      %td Koike
      %td 22
      %td Nonaka
      %td 89



                body { padding: 1rem; }

table, tr, th, td {
  border: 1px solid #eee;
  text-align: left;
  width: 50%;



                $(function() {
  // 並べ替え順を設定する
  var sortOrder = 1; // 1:昇順, 2:降順
  // 列をクリックしたら
  $('.doTheSort').on('click', function() {
    // data-type を取得する
    var type = $(this).data('type'); // string, integer
    // 何カラム目かを取得する
    var colNum = $(this).index(); // 0, 1, ...
    // 行全体を取得する
    var $rows = $('tbody>tr');
    // 行を点数で並び替える
    $rows.sort(function(a, b) {
      return compare(a, b, type, colNum) * sortOrder;
    // tbody を並び替えられた行全体に入れ替える
    // ソートを表す矢印を表示する
    var arrow = sortOrder === 1 ? '▲' : '▼';
    $('.doTheSort > span').text('');
    // 並び順を反転する
    sortOrder *= -1;

  function compare(a, b, type, colNum) {
    var _a = $(a).find('td').eq(colNum).text();
    var _b = $(b).find('td').eq(colNum).text();

    if (type == 'string') {
      if (_a < _b) { return -1; }
      if (_a > _b) { return 1; }
      return 0;
    } else {
      _a *= 1;
      _b *= 1;
      return _a - _b;