diff --git a/codepot/src/codepot/views/wiki_editx.php b/codepot/src/codepot/views/wiki_editx.php
index 1ea40d46..77f93815 100644
--- a/codepot/src/codepot/views/wiki_editx.php
+++ b/codepot/src/codepot/views/wiki_editx.php
@@ -28,8 +28,8 @@
 
 ';
+        html += this._cellsHTML();
+        html += '
';
+        return html;
+    },
+
+    _cellsHTML: function () {
+        var html = '';
+        this._generateCells();
+        this._cells.map(function (cell) {
+            html += '';
+            html += ' ';
+        });
+        return html;
+    },
+
+    _render: function () {
+        this._root.innerHTML = this._html();
+        this._cellsElements = this._root.querySelectorAll('a');
+        this._bindEvents();
+    },
+
+    _bindEvents: function () {
+        [].forEach.call(this._cellsElements, function (el) {
+            this._onMouseEnter(el);
+            this._onClick(el);
+        }.bind(this));
+    },
+
+    _onMouseEnter: function (el) {
+        var self = this,
+            timer;
+
+        el.addEventListener('mouseenter', function () {
+            clearTimeout(timer);
+
+            var dataset = this.dataset;
+
+            timer = setTimeout(function () {
+                self._currentCell = {
+                    column: parseInt(dataset.column, 10),
+                    row: parseInt(dataset.row, 10)
+                };
+                self.markCells();
+            }, 50);
+        });
+    },
+
+    _onClick: function (el) {
+        var self = this;
+        el.addEventListener('click', function (e) {
+            e.preventDefault();
+            self._callback(this.dataset.row, this.dataset.column);
+        });
+    }
+};
+
+function Builder(options) {
+    return this.init(options);
+}
+
+Builder.prototype = {
+    init: function (options) {
+        this.options = options;
+        this._doc = options.ownerDocument || document;
+        this._root = this._doc.createElement('div');
+        this._root.className = 'medium-editor-table-builder';
+        this.grid = new Grid(
+          this._root,
+          this.options.onClick,
+          this.options.rows,
+          this.options.columns
+        );
+
+        this._range = null;
+        this._toolbar = this._doc.createElement('div');
+        this._toolbar.className = 'medium-editor-table-builder-toolbar';
+
+        var spanRow = this._doc.createElement('span');
+        spanRow.innerHTML = 'Row:';
+        this._toolbar.appendChild(spanRow);
+        var addRowBefore = this._doc.createElement('button');
+        addRowBefore.title = 'Add row before';
+        addRowBefore.innerHTML = ' exists, don't add a column
+                td = this._doc.createElement('th');
+                if (before)
+                    thead.childNodes[0].insertBefore(td, thead.childNodes[0].childNodes[cell]);
+                else if (thead.childNodes[0].childNodes[cell].nextSibling)
+                    thead.childNodes[0].insertBefore(td, thead.childNodes[0].childNodes[cell].nextSibling);
+                else
+                    thead.childNodes[0].appendChild(td);
+            }
+        }
+
+        var in_thead = this._range.parentNode.parentNode.tagName.toLowerCase() == 'thead';
+        if (in_thead)
+        {
+            // the current cell is the header.
+            var thead = this._range.parentNode.parentNode;
+            var table = thead.parentNode;
+            tbody = table.childNodes[1];
+        }
+        else
+        {
+            tbody = this._range.parentNode.parentNode;
+        }
+        // end codepot
+
+        for (var i = 0; i < tbody.childNodes.length; i++) {
+            td = this._doc.createElement('td');
+            td.appendChild(this._doc.createElement('br'));
+            if (before === true) {
+                tbody.childNodes[i].insertBefore(td, tbody.childNodes[i].childNodes[cell]);
+            // codepot
+            //} else if (this._range.parentNode.parentNode.childNodes[i].childNodes[cell].nextSibling) {
+            } else if (tbody.childNodes[i].childNodes[cell].nextSibling) {
+            // end codepot
+                tbody.childNodes[i].insertBefore(td, tbody.childNodes[i].childNodes[cell].nextSibling);
+            } else {
+                tbody.childNodes[i].appendChild(td);
+            }
+        }
+
+        // codepot
+        //this.options.onClick(0, 0);
+        this.options.onClick(-1, -1);
+        // end codepot
+    },
+
+    removeColumn: function (e) {
+        e.preventDefault();
+        e.stopPropagation();
+        
+        // codepot
+        //var cell = Array.prototype.indexOf.call(this._range.parentNode.childNodes, this._range),
+        //    tbody = this._range.parentNode.parentNode,
+        //    rows = tbody.childNodes.length;
+
+        var table, thead, tbody, rows;
+        var cell = Array.prototype.indexOf.call(this._range.parentNode.childNodes, this._range);
+
+        if (this._range.parentNode.parentNode.tagName.toLowerCase() == 'thead')
+        {
+            // the current cell is the header.
+            thead = this._range.parentNode.parentNode;
+            table = thead.parentNode;
+            tbody = table.childNodes[1];
+        }
+        else
+        {
+            tbody = this._range.parentNode.parentNode;
+            table = tbody.parentNode;
+        }
+        rows = tbody.childNodes.length;
+
+        if (table.childNodes[0].tagName.toLowerCase() == 'thead')
+        {
+            var thead = table.childNodes[0];
+            if (thead.childNodes[0])
+            {
+                // if no   is inside , don't delete any.
+                thead.childNodes[0].removeChild (thead.childNodes[0].childNodes[cell]);
+            }
+        }
+        // end codepot
+
+        for (var i = 0; i < rows; i++) {
+            tbody.childNodes[i].removeChild(tbody.childNodes[i].childNodes[cell]);
+        }
+
+        // codepot
+        //this.options.onClick(0, 0);
+        this.options.onClick(-1, -1);
+        // end codepot
+    },
+
+    removeTable: function (e) {
+        e.preventDefault();
+        e.stopPropagation();
+        var cell = Array.prototype.indexOf.call(this._range.parentNode.childNodes, this._range),
+            table = this._range.parentNode.parentNode.parentNode;
+
+        table.parentNode.removeChild(table);
+        this.options.onClick(0, 0);
+    }
+};
+
+function Table(editor) {
+    return this.init(editor);
+}
+
+var TAB_KEY_CODE = 9;
+
+Table.prototype = {
+    init: function (editor) {
+        this._editor = editor;
+        this._doc = this._editor.options.ownerDocument;
+        this._bindTabBehavior();
+    },
+
+    insert: function (rows, cols) {
+
+        var html = this._html(rows, cols);
+        // codepot
+        var header = this._header(rows, cols);
+        // end codepot
+
+        this._editor.pasteHTML(
+            '' +
+            // codepot
+            '' +
+            header +
+            ' ' +
+            // end codepot
+            '' +
+            html +
+            ' ' +
+            '
', {
+                cleanAttrs: [],
+                cleanTags: []
+            }
+        );
+
+        var table = this._doc.getElementById('medium-editor-table');
+        table.removeAttribute('id');
+        placeCaretAtNode(this._doc, table.querySelector('td'), true);
+
+        this._editor.checkSelection();
+    },
+
+    // codepot
+    _header: function (rows, cols) {
+        var html = '', x, y;
+
+        for (x = 0; x < 1; x++) {
+            html += '' + y + ' ';
+            }
+            html += '' + x + ' ';
+            // end codepot
+            for (y = 0; y <= cols; y++) {
+                html += '' + (x === 0 && y === 0 ? text : ' ';
+            }
+            html += '"},_cellsHTML:function(){var a="";return this._generateCells(),this._cells.map(function(b){a+='',a+=" "}),a},_render:function(){this._root.innerHTML=this._html(),this._cellsElements=this._root.querySelectorAll("a"),this._bindEvents()},_bindEvents:function(){[].forEach.call(this._cellsElements,function(a){this._onMouseEnter(a),this._onClick(a)}.bind(this))},_onMouseEnter:function(a){var b,c=this;a.addEventListener("mouseenter",function(){clearTimeout(b);var a=this.dataset;b=setTimeout(function(){c._currentCell={column:parseInt(a.column,10),row:parseInt(a.row,10)},c.markCells()},50)})},_onClick:function(a){var b=this;a.addEventListener("click",function(a){a.preventDefault(),b._callback(this.dataset.row,this.dataset.column)})}},g.prototype={init:function(a){this.options=a,this._doc=a.ownerDocument||document,this._root=this._doc.createElement("div"),this._root.className="medium-editor-table-builder",this.grid=new f(this._root,this.options.onClick,this.options.rows,this.options.columns),this._range=null,this._toolbar=this._doc.createElement("div"),this._toolbar.className="medium-editor-table-builder-toolbar";var b=this._doc.createElement("span");b.innerHTML="Row:",this._toolbar.appendChild(b);var c=this._doc.createElement("button");c.title="Add row before",c.innerHTML='e;e++)c.childNodes[e].removeChild(c.childNodes[e].childNodes[b]);this.options.onClick(0,0)},removeTable:function(a){a.preventDefault(),a.stopPropagation();var b=(Array.prototype.indexOf.call(this._range.parentNode.childNodes,this._range),this._range.parentNode.parentNode.parentNode);b.parentNode.removeChild(b),this.options.onClick(0,0)}};var i=9;h.prototype={init:function(a){this._editor=a,this._doc=this._editor.options.ownerDocument,this._bindTabBehavior()},insert:function(a,b){var d=this._html(a,b);this._editor.pasteHTML('",{cleanAttrs:[],cleanTags:[]});var e=this._doc.getElementById("medium-editor-table");e.removeAttribute("id"),c(this._doc,e.querySelector("td"),!0),this._editor.checkSelection()},_html:function(b,c){var d,e,f="",g=a(this._doc);for(d=0;b>=d;d++){for(f+="",e=0;c>=e;e++)f+=""+(0===d&&0===e?g:" ";f+=" "}return f},_bindTabBehavior:function(){var a=this;[].forEach.call(this._editor.elements,function(b){b.addEventListener("keydown",function(b){a._onKeyDown(b)})})},_onKeyDown:function(a){var f,g=b(this._doc);a.which===i&&d(g,"table")&&(a.preventDefault(),a.stopPropagation(),f=this._getTableElements(g),a.shiftKey?this._tabBackwards(g.previousSibling,f.row):(this._isLastCell(g,f.row,f.root)&&this._insertRow(e(g,"tbody"),f.row.cells.length),c(this._doc,g)))},_getTableElements:function(a){return{cell:e(a,"td"),row:e(a,"tr"),root:e(a,"table")}},_tabBackwards:function(a,b){a=a||this._getPreviousRowLastCell(b),c(this._doc,a,!0)},_insertRow:function(a,b){var c,d=document.createElement("tr"),e="";for(c=0;b>c;c+=1)e+="