anchor.diff:      begin
         // Table fits into NewWidth.
   
  -      // Calculate widths with respect to percentage specifications.
         Counts[wtPercent] := 0;
  +      PercentAbove0Count := 0;
         for I := 0 to NumCols - 1 do
  -      begin
  -        wt := ColumnSpecs[I];
  -        case wt of
  -          wtPercent:
  -          begin
  -            Widths[I] := Max(MinWidths[I], MulDiv(NewWidth, Percents[I], 1000));
  -            Inc(Counts[wtPercent]);
  -          end;
  -        else
  -          Widths[I] := MinWidths[I];
  +        if ColumnSpecs[I] = wtPercent then
  +        begin
  +          Inc(Counts[wtPercent]);
  +          if Percents[I] > 0 then
  +            Inc(PercentAbove0Count);
           end;
  +
  +      Widths := Copy(MinWidths);
  +      if (PercentAbove0Count > 0) and (NewWidth > 0) then
  +      begin
  +        // Calculate widths with respect to percentage specifications.
  +        // Don't shrink Column i below MinWidth[i]! Therefor spread exessive space
  +        // trying to fit the percentage demands.
  +        // If there are more than 100% percent reduce linearly to 100% (including
  +        // the corresponding percentages of the MinWidth of all other columns).
  +        SetLength(PercentDeltas, NumCols);
  +        CalcPercentDeltas(PercentDeltas, NewWidth);
  +
  +        PercentDeltaAbove0Count := 0;
  +        for I := 0 to NumCols - 1 do
  +          if PercentDeltas[I] > 0 then
  +            Inc(PercentDeltaAbove0Count);
  +
  +
  +        IncreaseWidthsByPercentage(Widths, PercentDeltas, 0, NumCols - 1, NewWidth, MinWidth, Sum(PercentDeltas), PercentDeltaAbove0Count);
         end;
         MinWidth := Sum(Widths);
   
  
positive.code:       end;
      end;
  
    var
      Specified: boolean;
      NewWidth, MaxWidth, MinWidth, D, W, I: Integer;
      Counts: TIntegerPerWidthType;
      wt: TWidthType;
    begin
      Specified := tblWidthAttr > 0;
      if Specified then
  
negative.code:       else
        begin
          // add the remaining pixels to the first column's width.
          Inc(Widths[I], Excess - AddedExcess);
          break;
        end;
  end;
  