Search Results for

    Show / Hide Table of Contents

    Class MergeCell

    Represents a range of cells that are merged into a single cell.

    Inheritance
    System.Object
    MergeCell
    Namespace: IronWord.Models
    Assembly: IronWord.dll
    Syntax
    public class MergeCell : Object

    When two or more table cells should read as one, a MergeCell records the rectangular block they span. It captures the corner coordinates of a merge so a table can present a single combined cell, the pattern behind a header that stretches across columns or a label that runs down several rows.

    A merge is defined by four zero-based coordinates: StartRow and StartColumn mark the top-left cell of the block, and EndRow and EndColumn mark the bottom-right. The range between those corners becomes the merged region. In practice you do not build the geometry by hand for every case; a Table exposes MergeCells, which takes the same start-row, start-column, end-row, and end-column arguments and performs the merge, while the table's MergedCells property lists the MergeCell records already applied. Reading that list tells you which regions of an existing table are combined.

    Set the four coordinates to cover the block you want, keeping the start corner above and to the left of the end corner, then let the table apply it. Because the values are zero-based, the first row and first column are index 0, so a header spanning the first three columns of the top row runs from (0, 0) to (0, 2). Once merged, the cells behave as the single cell at the start corner, which is where content for the region is read and written through GetCell. The cells absorbed into the block no longer hold their own content, so populate the start cell after the merge rather than before. A table can carry several merges at once, each its own MergeCell record, which is how a layout combines a banner row and a stacked label column in the same grid.

    table.MergeCells(0, 0, 0, 2);

    The add table example builds a table, the add table how-to walks through cells and layout in detail, and the document element tutorial places tables within a document.

    Constructors

    MergeCell()

    Declaration
    public MergeCell()

    Properties

    EndColumn

    Gets or sets the ending column index of the merged cell.

    Declaration
    public int EndColumn { get; set; }
    Property Value
    Type Description
    System.Int32

    EndRow

    Gets or sets the ending row index of the merged cell.

    Declaration
    public int EndRow { get; set; }
    Property Value
    Type Description
    System.Int32

    StartColumn

    Gets or sets the starting column index of the merged cell.

    Declaration
    public int StartColumn { get; set; }
    Property Value
    Type Description
    System.Int32

    StartRow

    Gets or sets the starting row index of the merged cell.

    Declaration
    public int StartRow { get; set; }
    Property Value
    Type Description
    System.Int32
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet
    IronWord_for_dotnet_log2o
    Blue key in circleGet started for FREE
    No credit card required
    Test in a live environment

    Test in production without watermarks.
    Works wherever you need it to.

    Fully-functional product

    Get 30 days of fully functional product.
    Have it up and running in minutes.

    24/5 technical support

    Full access to our support engineering team during your product trial

    Grey key in circleGet started for FREE
    The trial form was submitted successfully.
    Calendar in circleBook Free Live Demo
    No contact, no card details, no commitments Book a 30-minute, personal demo.
    Here's what to expect:

    A live demo of our product and its key features

    Get project specific feature recommendations

    All your questions are answered to make sure you have all the information you need. (No commitment whatsoever.)

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation
    Support Team Member 6 related to The C# PDF Library Support Team Member 14 related to The C# PDF Library Support Team Member 4 related to The C# PDF Library Support Team Member 2 related to The C# PDF Library
    Online 24/5
    Need help? Our sales team would be glad to help you.
    Try the Enterprise Trial
    ironpdf_for_dotnet_log2o
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    bullet_checkedNo credit card or account creation required
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    Blue key in circleNo credit card or account creation required
    Green Check in orange circle
    The trial form was submitted successfully.
    badge_greencheck_in_yellowcircle
    Thank you for starting a trial

    Please check your email for the trial license key.

    If you don’t receive an email, please start a live chat or email support@ironsoftware.com

    Install with NuGet
    View Licensing
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronWord