iTextSharp.text.Cell.SetWidth C# (CSharp) Метод

SetWidth() публичный Метод

public SetWidth ( String value ) : void
value String
Результат void
        public void SetWidth(String value) {
            if (value.EndsWith("%")) {
                value = value.Substring(0, value.Length - 1);
                percentage = true;
            }
            width = int.Parse(value);
        }
        

Usage Example

Пример #1
0
        public static Cell GetCell(Properties attributes)
        {
            Cell cell = new Cell();
            String value;

            cell.SetHorizontalAlignment(attributes[ElementTags.HORIZONTALALIGN]);
            cell.SetVerticalAlignment(attributes[ElementTags.VERTICALALIGN]);
            value = attributes[ElementTags.WIDTH];
            if (value != null) {
                cell.SetWidth(value);
            }
            value = attributes[ElementTags.COLSPAN];
            if (value != null) {
                cell.Colspan = int.Parse(value);
            }
            value = attributes[ElementTags.ROWSPAN];
            if (value != null) {
                cell.Rowspan = int.Parse(value);
            }
            value = attributes[ElementTags.LEADING];
            if (value != null) {
                cell.Leading = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            cell.Header = Utilities.CheckTrueOrFalse(attributes, ElementTags.HEADER);
            if (Utilities.CheckTrueOrFalse(attributes, ElementTags.NOWRAP)) {
                cell.MaxLines = 1;
            }
            SetRectangleProperties(cell, attributes);
            return cell;
        }