jQuery delete table column

A column is pretty much just cells, so you'll need to manually loop through all the rows and remove the cell by the index.

This should give you a good starting point for removing the 3rd column:

$("tr").each(function() {
    $(this).children("td:eq(2)").remove();
});

This uses .delegate() for the handler, and a more native approach using cellIndex to get the cell index that was clicked, and cells to pull the cell from each row.

Example: http://jsfiddle.net/zZDKg/1/

$('table').delegate('td,th', 'click', function() {
    var index = this.cellIndex;
    $(this).closest('table').find('tr').each(function() {
        this.removeChild(this.cells[ index ]);
    });
});

Tags:

Jquery