Procházet zdrojové kódy

Added SetWidthsPercentage(float[] widthsPercentage, float? totalWidth) for Tables as per kanadmehta proposition (#42)

master
PrzemyslawKlys před 9 roky
rodič
revize
800a1618b7
4 změnil soubory, kde provedl 13 přidání a 1 odebrání
  1. 13
    1
      DocX/Table.cs
  2. binární
      DocX/bin/Debug/DocX.dll
  3. binární
      DocX/bin/Release/DocX.dll
  4. binární
      Documentation/Help/Documentation.chm

+ 13
- 1
DocX/Table.cs Zobrazit soubor

} }
} }
/// <summary>
/// Set Table column width by prescribing percent
/// </summary>
/// <param name="widthsPercentage">column width % list</param>
/// <param name="totalWidth">Total table width. Will be calculated if null sent.</param>
public void SetWidthsPercentage(float[] widthsPercentage, float? totalWidth)
{
if (totalWidth == null) totalWidth = this.Document.PageWidth - this.Document.MarginLeft - this.Document.MarginRight; // calculate total table width
List<float> widths = new List<float>(widthsPercentage.Length); // empty list, will hold actual width
widthsPercentage.ToList().ForEach(pWidth => { widths.Add(pWidth * totalWidth.Value / 100); }); // convert percentage to actual width for all values in array
SetWidths(widths.ToArray()); // set actual column width
}
/// <summary> /// <summary>
public bool NoHorizontalBanding { get; set; } public bool NoHorizontalBanding { get; set; }
public bool NoVerticalBanding { get; set; } public bool NoVerticalBanding { get; set; }
} }
} }

binární
DocX/bin/Debug/DocX.dll Zobrazit soubor


binární
DocX/bin/Release/DocX.dll Zobrazit soubor


binární
Documentation/Help/Documentation.chm Zobrazit soubor


Načítá se…
Zrušit
Uložit