               unit = attribute.width.match(/[px|%]+/)[0]
 
               if unit is '%'
-                attribute.displayWidth = value / 100 * @el.width()
+                attribute.displayWidth = value / 100 * availableWidth
               else
                 attribute.displayWidth = value
             @headers.push attribute

      return col

    # give left-over space from rounding to last column to get to 100%
    roundingLeftOver = @availableWidth - @getHeaderWidths()
    # but only if there is something left over (will get negative when there are too many columns for each column to stay in their min width)
    if roundingLeftOver > 0
      @headers[@headers.length - 1].displayWidth = @headers[@headers.length - 1].displayWidth + roundingLeftOver

            if attributeName is "#{item}_id" || attributeName is "#{item}_ids"
              headerFound = true
              if @headerWidth[attribute.name]
                attribute.displayWidth = @headerWidth[attribute.name] * availableWidth
              else if !attribute.width
                attribute.displayWidth = @baseColWidth
              else
