Add div tag element for separate element to th tag of a html table tag and use for resize column in datatables
function addDiv(thtag, tableId) { $(thtag).append("<div></div>"); var table = $("#" + tableId).DataTable(); var html = ""; var i = 0; var width = table.columns().eq(i).width(); $(thtag + " div").css("width", width); $(thtag).css("width", width); $(thtag + " div").css("height", "100%"); $(thtag).css("height", "100%"); $(thtag + " div").css("float", "right"); $(thtag + " div").css("cursor", "col-resize"); $(thtag + " div").draggable({ axis: 'x', start: function (event, ui) { var width = table.columns().eq(i).width(); $(thtag + " div").css("width", width); $(thtag).css("width", width); }, stop: function (