getOuterRange = function (range) {
                    var getRange = function(){
                        $abledTds.each(function () {
                            var $temp = $(this);
                            var t_fromKey = $temp.data('from');
                            var t_toKey = $temp.data('to');
                            var t_from = t_fromKey.split(':').map(function (value) { return +value; });
                            var t_to = t_toKey.split(':').map(function (value) { return +value; });
                            if (isInRange({ from: t_from, to: t_to }, range)) {
                                cellList.push({
                                    'from': t_from,
                                    'to': t_to,
                                });
                            }
                        });
                        var outer_from = [Math.min.apply(null, cellList.map(function (item) {
                            return Math.min(item['from'][0],item['to'][0]);
                        })), Math.min.apply(null, cellList.map(function (item) {
                            return Math.min(item['from'][1],item['to'][1]);
                        }))];
                        var outer_to = [Math.max.apply(null, cellList.map(function (item) {
                            return Math.max(item['from'][0],item['to'][0]);
                        })), Math.max.apply(null, cellList.map(function (item) {
                            return Math.max(item['from'][1],item['to'][1]);
                        }))];
                        return {
                            from: outer_from,
                            to: outer_to
                        };
                    };
                    var temp_range = JSON.parse(JSON.stringify(selected_range));
                    var outer_range = getRange(temp_range);
                    while (outer_range['from'][0] != temp_range['from'][0] || outer_range['from'][1] != temp_range['from'][1] || outer_range['to'][0] != temp_range['to'][0] || outer_range['to'][1] != temp_range['to'][1]) {
                        temp_range = outer_range;
                        outer_range = getRange(outer_range);
                    }
                    return outer_range;
                }
jquery.tableselect.js 1.1
http://jquerywidget.com