Ahmed Shair
Ahmed Shair

Reputation: 99

How can we add a table with 3 rows in footer using aspose.words in .Net

I'm using Aspose.words in .net API and getting in an issue to add a separate table in word footer using this tool. Can anyone expedite me to do this?

Upvotes: 1

Views: 294

Answers (1)

Zeeshan Mahboob
Zeeshan Mahboob

Reputation: 194

You can Insert a Table in Word footer with three cells using below piece of code:

           var doc = new Document();

            var builder = new DocumentBuilder(doc)
            {
                PageSetup =
                {
                    Orientation = Orientation.Portrait,
                    PaperSize = PaperSize.Letter
                },

            };
        builder.MoveToHeaderFooter(Word.HeaderFooterType.FooterPrimary);
        builder.StartTable();
            builder.InsertCell();
            builder.CurrentParagraph.ParagraphFormat.Alignment = Word.ParagraphAlignment.Center;
            builder.Write("Cell 1");


            builder.InsertCell();
            builder.CurrentParagraph.ParagraphFormat.Alignment = Word.ParagraphAlignment.Center;
            builder.Write("Cell 2");

            builder.InsertCell();
            builder.CurrentParagraph.ParagraphFormat.Alignment = Word.ParagraphAlignment.Center;
            builder.Write("Cell 3");

        builder.EndTable();
        builder.MoveToDocumentEnd();

Upvotes: 1

Related Questions