;(function($) {
  $.fn.easyTable = function( action , options ) {
    var opts = $.extend( {}, $.fn.easyTable.defaults, options );

    var $this = $(this);
    var $scrollableFather = $this.parents().filter( function() {
                  return $(this).css('overflow') == 'auto';
               });

      switch ( action ) {
        case 'fixedHead':
            var $t_fixed;
            _fixedHeader();
            _resizeFixedHeader();
            $(window).resize(_resizeFixedHeader);
            break;
        case 'undoFixedHead':
            var $t_fixed = $("#" + $this.attr('id') + '-fixedClone');
            var header = $t_fixed.find('thead');
            var body = $this.find('tbody');
            $scrollableFather.unwrap();
            header.insertBefore(body);
            $t_fixed.remove();
            break;
        case 'addRow':
          if (typeof opts.beforeAdd == 'function'){
            opts.beforeAdd.call( $this );
          }

          var $tr = _addRow();

          if (typeof opts.afterAdd == 'function'){
            opts.afterAdd.call( $this, $tr );
          }

          break;
        case 'removeRow':
          if (typeof opts.beforeDelete == 'function'){
            opts.beforeDelete.call( $this );
          }

          opts.indexes.sort().reverse();
          opts.indexes.some( function ( value ) {
            $this.find('tbody tr')[value].remove();
          });

          if (typeof opts.afterDelete == 'function'){
            opts.afterDelete.call( $this );
          }

          break;
        case 'removeAllRows':
          if (typeof opts.beforeDeleteAll == 'function'){
            opts.beforeDeleteAll.call( $this );
          }

          $this.find('tbody tr').remove();

          if (typeof opts.afterDeleteAll == 'function'){
            opts.afterDeleteAll.call( $this );
          }

          break;
      }

    function _fixedHeader() {
        $scrollableFather.wrap('<div id="container-easyTable" />');
        $t_fixed = $this.clone();
        $t_fixed.attr('id', $t_fixed.attr('id') + '-fixedClone');
        $t_fixed.find("tbody").remove().end().addClass("fixedEasyTable").insertBefore($scrollableFather);
        _resizeFixedHeader();
    }

    function _resizeFixedHeader() {

        $t_fixed.find("th").each(function(index) {
          $(this).css("width",$this.find("th").eq(index).css('width'));
        });

    		$this.find("thead").remove();
    		$this.find("tr").first().children().each( function (index) {
    			$(this).css("width", $t_fixed.find("th").eq(index).css('width'));
    		});
    }

  	function getScrollbarWidth() {
  		var outer = document.createElement("div");
  		outer.style.visibility = "hidden";
  		outer.style.width = "100px";
  		outer.style.msOverflowStyle = "scrollbar";

  		document.body.appendChild(outer);

  		var widthNoScroll = outer.offsetWidth;

  		outer.style.overflow = "scroll";

  		var inner = document.createElement("div");
  		inner.style.width = "100%";
  		outer.appendChild(inner);

  		var widthWithScroll = inner.offsetWidth;

  		outer.parentNode.removeChild(outer);

  		return widthNoScroll - widthWithScroll;
  	}

    function _scrollFixedHeader() {
        $t_fixed.show();
    }

    function _addRow() {
      $newRow = $('<tr>');

      opts.columnsValues.some( function ( columnValue, index ) {
        $td = $('<td>');
        $td.append(columnValue);
        $newRow.append($td);

        if ( typeof opts.columnsNames[index] != 'undefined' ) {
          $td.attr('name', opts.columnsNames[index]);
        }

        if ( typeof opts.columnsIDs[index] != 'undefined' ) {
          $td.attr('id', opts.columnsIDs[index]);
        }

      });

      if (typeof opts.animateAdd == 'function') {
          opts.animateAdd.call( 'undefined' , $this, $newRow );
      }

      $this.append($newRow);

      return $newRow;
    };

    return this;
  };

  $.fn.easyTable.defaults = {
    indexes: [],
    columnsValues: [],
    columnsNames: [],
    columnsIDs: []
  };

})(jQuery);

@@ -2385,25 +2385,113 @@
         %7D);%0A
+        %0A        $t_fixed.css('width', $scrollableFather.width() - getScrollbarWidth());
 %0A
-
     %09%09$this.
@@ -2705,16 +2705,74 @@
 dth() %7B%0A
+  %09%09if ( $this.height() %3E $scrollableFather.height() ) %0A  
   %09%09var 
@@ -2808,24 +2808,26 @@
 t(%22div%22);%0A  
+ 
+ 
 %09%09outer.styl
@@ -2851,16 +2851,18 @@
 idden%22;%0A
+  
   %09%09oute
@@ -2884,24 +2884,26 @@
  %22100px%22;%0A  
+ 
+ 
 %09%09outer.styl
@@ -2935,19 +2935,23 @@
 llbar%22;%0A
-%0A
+  %0A 
   
+ 
 %09%09docume
@@ -2974,27 +2974,31 @@
 ild(outer);%0A
-%0A
+  %0A 
   
+ 
 %09%09var widthN
@@ -3018,33 +3018,37 @@
 er.offsetWidth;%0A
+  
 %0A
+  
   %09%09outer.style.
@@ -3068,17 +3068,21 @@
 croll%22;%0A
-%0A
+  %0A  
   %09%09var 
@@ -3120,16 +3120,18 @@
 %22div%22);%0A
+  
   %09%09inne
@@ -3154,16 +3154,18 @@
 %22100%25%22;%0A
+  
   %09%09oute
@@ -3182,25 +3182,29 @@
 ild(inner);%0A
-%0A
+  %0A  
   %09%09var widt
@@ -3236,17 +3236,21 @@
 tWidth;%0A
-%0A
+  %0A  
   %09%09oute
@@ -3282,17 +3282,21 @@
 outer);%0A
-%0A
+  %0A  
   %09%09retu
@@ -3331,16 +3331,38 @@
 Scroll;%0A
+  %09  %7D%0A  %09  return 0;%0A
   %09%7D%0A%0A  

fix when father hasnt have scrollbar, #1 close