HtmlForgeX

API Reference

Class

EmailRow

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email

Represents a table-based row layout for email compatibility. Uses HTML tables instead of CSS flexbox/grid for maximum email client support.

Inheritance

Constructors

EmailRow 2 overloads
public EmailRow() #

Initializes a new instance of the EmailRow class.

public EmailRow(String cssClass) #

Initializes a new instance of the EmailRow class with a custom CSS class.

Parameters

cssClass System.String requiredposition: 0
The CSS class to apply.

Methods

public EmailColumn AddColumn(Action<EmailColumn> config) #
Returns: EmailColumn

Adds a column to the row using a configuration action.

Parameters

config System.Action{HtmlForgeX.Email.EmailColumn} requiredposition: 0
The configuration action for the column.

Returns

The EmailColumn that was added.

public EmailRow AddSpacer(Int32 width = 24) #
Returns: EmailRow

Adds a spacer column to create spacing between content columns.

Parameters

width System.Int32 = 24 optionalposition: 0
The width of the spacer in pixels.

Returns

The EmailRow object, allowing for method chaining.

public EmailRow DisableAutoSpacing() #
Returns: EmailRow

Disables automatic spacing between columns.

Returns

The EmailRow object, allowing for method chaining.

public override Void EvaluateLayout(LayoutContext context) #
Returns: Void

Overrides layout evaluation to preserve manually set margins.

Parameters

context HtmlForgeX.Email.LayoutContext requiredposition: 0
public override String ToString() #
Returns: String

Converts the EmailRow to its HTML table representation.

Returns

HTML string representing the email row as a table.

WithBackgroundColor 2 overloads
public EmailRow WithBackgroundColor(RGBColor color) #
Returns: EmailRow

Sets the background color for the row.

Parameters

color System.String requiredposition: 0
The background color.

Returns

The EmailRow object, allowing for method chaining.

WithBackgroundColor(HtmlForgeX.Email.RGBColor color) #

Sets the background color for the row using RGBColor.

Parameters

color HtmlForgeX.Email.RGBColor required
The background color.

Returns

The EmailRow object, allowing for method chaining.

public EmailRow WithEqualHeightColumns(Boolean enabled = true) #
Returns: EmailRow

Controls equal height columns behavior. When enabled (default), all columns visually appear the same height. This is achieved by setting the background on the column cells rather than nested elements.

Parameters

enabled System.Boolean = true optionalposition: 0
Whether to enable equal height columns. Default is true.

Returns

The EmailRow object for chaining.

WithPadding(HtmlForgeX.Email.Spacing padding) #

Sets the padding for the row using Spacing enum.

Parameters

padding HtmlForgeX.Email.Spacing required
The padding size.

Returns

The EmailRow object, allowing for method chaining.

WithSpacing 2 overloads
public EmailRow WithSpacing(EmailSpacing spacing) #
Returns: EmailRow

Sets the spacing around the row using semantic sizing.

Parameters

spacing HtmlForgeX.Email.EmailSpacing requiredposition: 0
The spacing size to apply.

Returns

The EmailRow object, allowing for method chaining.

public EmailRow WithSpacing(EmailSpacing above, EmailSpacing below) #
Returns: EmailRow

Sets different spacing above and below the row.

Parameters

above HtmlForgeX.Email.EmailSpacing requiredposition: 0
The spacing size above.
below HtmlForgeX.Email.EmailSpacing requiredposition: 1
The spacing size below.

Returns

The EmailRow object, allowing for method chaining.

Properties

public String TableLayout { get; set; } #

Gets or sets the table layout mode.

public String ColumnSpacing { get; set; } #

Gets or sets the spacing between columns.

public Boolean EqualHeightColumns { get; set; } #

Gets or sets whether columns should maintain equal heights. Note: Equal height columns are challenging in email HTML and may not work in all clients. Consider using consistent content structure instead.

public Boolean AutoSpaceColumns { get; set; } #

Gets or sets whether to automatically add spacing between columns.

public String BackgroundColor { get; set; } #

Gets or sets the background color for the row.