code: function tableButtonClick(e, data) {
  
      // Wire up the submit button click event handler
      $(data.popup).children(":button")
        .unbind("click")
        .bind("click", function(e) {
  
          // Get the editor
          var editor = data.editor;
  
          // Get the column and row count
          var $text = $(data.popup).find(":text"),
            cols = parseInt($text[0].value),
            rows = parseInt($text[1].value),
            spacing = parseInt($text[2].value),
            padding = parseInt($text[3].value),
            border = parseInt($text[4].value),
            styles = $text[5].value;
  
          if (parseInt(cols) < 1 || !parseInt(cols)) cols = 0;
          if (parseInt(rows) < 1 || !parseInt(rows)) rows = 0;
          if (parseInt(spacing) < 1 || !parseInt(spacing)) spacing = 0;
          if (parseInt(padding) < 1 || !parseInt(padding)) padding = 0;
          if (parseInt(border) < 1 || !parseInt(border)) border = 0;
  
          // Build the html
          var html;
          if (cols > 0 && rows > 0) {
            html = "<table border=" + border + " cellpadding=" + padding +
              " cellspacing=" + spacing + 
              (styles ? ' style="' + styles + '"' : "") + ">";
            for (y = 0; y < rows; y++) {
              html += "<tr>";
              for (x = 0; x < cols; x++)
                html += "<td>" + x + "," + y + "</td>";
              html += "</tr>";
            }
            html += "</table><br />";
          }
  
          // Insert the html
          if (html)
            editor.execCommand(data.command, html, null, data.button);
  
          // Reset the text, hide the popup and set focus
          $text[0].value = "4";
          $text[1].value = "4";
          $text[2].value = "2";
          $text[3].value = "2";
          $text[4].value = "1";
          $text[5].value = "";
          editor.hidePopups();
          editor.focus();
  
        });
  
      }
docs: Table button click event handler