ApiExamples.ExTable.FixDefaultTableFormattingExceptionIn105 C# (CSharp) Метод

FixDefaultTableFormattingExceptionIn105() приватный Метод

private FixDefaultTableFormattingExceptionIn105 ( ) : void
Результат void
        public void FixDefaultTableFormattingExceptionIn105()
        {
            //ExStart
            //ExId:FixTableFormattingException
            //ExSummary:Shows how to avoid encountering an exception when applying table formatting.
            Document doc = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);

            // Keep a reference to the table being built.
            Table table = builder.StartTable();

            // We must first insert a new cell which in turn inserts a row into the table.
            builder.InsertCell();
            // Once a row exists in our table we can apply table wide formatting.
            table.AllowAutoFit = true;

            // Continue with building your table as usual...
            //ExEnd
        }