Search Results for

    Show / Hide Table of Contents

    Class HorizontalAlignment

    The enumeration value indicating horizontal alignment of a cell,

    I.e., whether it is aligned general, left, right, horizontally centered, Filled (replicated), justified, centered across multiple cells, or distributed.

    Inheritance
    System.Object
    HorizontalAlignment
    Namespace: IronXL.Styles
    Assembly: IronXL.dll
    Syntax
    public sealed class HorizontalAlignment : Enum

    Fields

    Center

    The horizontal alignment is centered, meaning the text is centered across the cell.

    Declaration
    public const HorizontalAlignment Center
    Field Value
    Type Description
    HorizontalAlignment

    CenterSelection

    The horizontal alignment is centered across multiple cells. The information about how many cells to span is expressed in the Sheet Part, in the row of the cell in question.

    For each cell that is spanned in the alignment, a cell element needs to be written out, with the same style Id which references the centerContinuous alignment.

    Declaration
    public const HorizontalAlignment CenterSelection
    Field Value
    Type Description
    HorizontalAlignment

    Distributed

    Indicates that each 'word' in each line of text inside the cell is evenly distributed across the width of the cell, with flush right and left margins.

    When there is also an indent value to apply, both the left and right side of the cell are pAdded by the indent value.

    A 'word' is a set of characters with no space character in them.

    Two lines inside a cell are Separated by a carriage return.

    Declaration
    public const HorizontalAlignment Distributed
    Field Value
    Type Description
    HorizontalAlignment

    Fill

    Indicates that the value of the cell should be Filled across the entire width of the cell. If blank cells to the right also have the fill alignment, they are also Filled with the value, using a convention similar to centerContinuous.

    Additional rules:

    Only whole values can be Appended, not partial values.

    The column will not be widened to 'best fit' the Filled value

    If Appending an Additional occurrence of the value exceeds the boundary of the cell left/right edge, don't append the Additional occurrence of the value.

    The display value of the cell is Filled, not the underlying raw number.

    Declaration
    public const HorizontalAlignment Fill
    Field Value
    Type Description
    HorizontalAlignment

    General

    The horizontal alignment is general-aligned.

    Text data is left-aligned. Numbers, dates, and times are right aligned. Boolean types are centered.

    Changing the alignment does not change the type of data.
    Declaration
    public const HorizontalAlignment General
    Field Value
    Type Description
    HorizontalAlignment

    Justify

    The horizontal alignment is justified (flush left and right). For each line of text, aligns each line of the wrapped text in a cell to the right and left (except the last line). If no single line of text wraps in the cell, then the text is not justified.

    Declaration
    public const HorizontalAlignment Justify
    Field Value
    Type Description
    HorizontalAlignment

    Left

    The horizontal alignment is left-aligned, even in Right-to-Left mode.

    Aligns contents at the left edge of the cell. If an indent amount is specified, the contents of the cell is indented from the left by the specified number of character spaces.

    The character spaces are based on the default font and font size for the workbook.
    Declaration
    public const HorizontalAlignment Left
    Field Value
    Type Description
    HorizontalAlignment

    Right

    The horizontal alignment is right-aligned, meaning that cell contents are aligned at the right edge of the cell, even in Right-to-Left mode.

    Declaration
    public const HorizontalAlignment Right
    Field Value
    Type Description
    HorizontalAlignment

    value__

    Declaration
    public int value__
    Field Value
    Type Description
    System.Int32
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    Want to deploy IronXL to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronXL free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.