I am trying to resize jquery table header columns. I can do it with in a single table but I am unable to do that if header is with fixed table header.
My jsfiddle trials are below:
How can I make fixed table header work with a resize pointer at end of th text?
$(function() {
var pressed;
var start;
var startX;
var startWidth;
var wrapper = $("div#wrapper");
var container = $("table#fixedHeaderTable");
$("table th").mousedown(function(e) {
start = $(this);
startX = e.pageX;
startWidth = $(this).width();
$(start).addClass("resizing");
pressed = true;
});
$(document).mousemove(function(e) {
if(pressed) {
var newWidth = startWidth + (e.pageX - startX);
start.width(newWidth);
wrapper.width(container.width() + 10);
}
});
$(document).mouseup(function() {
if(pressed) {
$(start).removeClass("resizing");
pressed = false;
}
});
});