     if @availableWidth is 0
       @availableWidth = @minTableWidth
 
+    availableWidth = @availableWidth
+
     widths = @getHeaderWidths()
-    shrinkBy = Math.ceil (widths - @availableWidth) / @getShrinkableHeadersCount()
+    shrinkBy = Math.ceil (widths - availableWidth) / @getShrinkableHeadersCount()
 
     # make all cols evenly smaller
     @headers = _.map @headers, (col) =>


    # get header data
    @headers = []
    for item in @overviewAttributes
      headerFound = false
      for attributeName, attribute of @attributesList

                unit = attribute.width.match(/[px|%]+/)[0]

                if unit is '%'
                  attribute.displayWidth = value / 100 * availableWidth
                else
                  attribute.displayWidth = value
              @headers.push attribute
