Aspose.Words.Examples.CSharp.Programming_Documents.Working_with_Tables.MergedCells.HorizontalMerge C# (CSharp) Method

HorizontalMerge() public static method

public static HorizontalMerge ( string dataDir ) : void
dataDir string
return void
        public static void HorizontalMerge(string dataDir)
        {
            // ExStart:HorizontalMerge         
            Document doc = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);

            builder.InsertCell();
            builder.CellFormat.HorizontalMerge = CellMerge.First;
            builder.Write("Text in merged cells.");

            builder.InsertCell();
            // This cell is merged to the previous and should be empty.
            builder.CellFormat.HorizontalMerge = CellMerge.Previous;
            builder.EndRow();

            builder.InsertCell();
            builder.CellFormat.HorizontalMerge = CellMerge.None;
            builder.Write("Text in one cell.");

            builder.InsertCell();
            builder.Write("Text in another cell.");
            builder.EndRow();
            builder.EndTable();
            dataDir = dataDir + "Table.HorizontalMerge_out.doc";

            // Save the document to disk.
            doc.Save(dataDir);
            // ExEnd:HorizontalMerge
            Console.WriteLine("\nTable created successfully with cells in the first row horizontally merged.\nFile saved at " + dataDir);
            
        }
        public static void MergeCellRange(string dataDir)