HtmlForgeX

API Reference

Class

EmailColumn

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email

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

Inheritance

Constructors

EmailColumn 2 overloads
public EmailColumn() #

Initializes a new instance of the EmailColumn class.

public EmailColumn(String cssClass) #

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

Parameters

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

Methods

Add 2 overloads
public EmailColumn Add(Action<BasicElement> config) #
Returns: EmailColumn

Adds an element to the column.

Parameters

element HtmlForgeX.Email.Element requiredposition: 0
The element to add.

Returns

The EmailColumn object, allowing for method chaining.

Add(System.Action{HtmlForgeX.Email.BasicElement} config) #

Adds content to the column using a configuration action.

Parameters

config System.Action{HtmlForgeX.Email.BasicElement} required
The configuration action for the content.

Returns

The EmailColumn object, allowing for method chaining.

public EmailColumn AddStyle(String style) #
Returns: EmailColumn

Adds inline CSS style to the column.

Parameters

style System.String requiredposition: 0
The CSS style to add.

Returns

The EmailColumn object, allowing for method chaining.

public EmailColumn AddText(String text) #
Returns: EmailColumn

Adds text content to the column.

Parameters

text System.String requiredposition: 0
The text to add.

Returns

The EmailColumn object, allowing for method chaining.

public EmailImage EmailImage(String source, String width, String height = "") #
Returns: EmailImage

Adds an EmailImage to the column with source and dimensions.

Parameters

source System.String requiredposition: 0
The image source URL or file path.
width System.String requiredposition: 1
The image width.
height System.String = "" optionalposition: 2
The image height.

Returns

The EmailImage object, allowing for method chaining.

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

Calculates column widths when explicit values are not provided.

Parameters

context HtmlForgeX.Email.LayoutContext requiredposition: 0
Layout evaluation context.
GetContentString() #

Gets the content string for the column (used internally by EmailRow).

Returns

HTML string representing the column content.

public EmailColumn SetWrapMode(EmailTextWrapMode wrapMode) #
Returns: EmailColumn

Sets the text wrapping mode for controlling how text breaks and wraps in this column.

Parameters

wrapMode HtmlForgeX.Email.EmailTextWrapMode requiredposition: 0
The text wrapping mode.

Returns

The EmailColumn object, allowing for method chaining.

public override String ToString() #
Returns: String

Converts the EmailColumn to its HTML representation. Note: This should typically not be called directly - columns are rendered by EmailRow.

Returns

HTML string representing the email column.

public EmailColumn WithAlignment(Alignment alignment) #
Returns: EmailColumn

Sets the text alignment of the column content.

Parameters

alignment HtmlForgeX.Email.Alignment requiredposition: 0
The alignment option.

Returns

The EmailColumn instance.

public EmailColumn WithNaturalWrapping() #
Returns: EmailColumn

Sets natural text wrapping for this column - only breaks at word boundaries. Perfect for columns containing method names like "ConfigureImageOptimization".

Returns

The EmailColumn object, allowing for method chaining.

public EmailColumn WithSmartWrapping() #
Returns: EmailColumn

Sets smart text wrapping for this column - tries to keep camelCase and method names intact. Best for technical documentation and API reference columns.

Returns

The EmailColumn object, allowing for method chaining.

public EmailColumn WithVerticalAlign(VerticalAlignment alignment) #
Returns: EmailColumn

Sets the vertical alignment of the column content.

Parameters

alignment HtmlForgeX.Email.VerticalAlignment requiredposition: 0
The vertical alignment option.

Returns

The EmailColumn instance.

public EmailColumn WithWidth(String width) #
Returns: EmailColumn

Sets the width of the column.

Parameters

width System.String requiredposition: 0
The width (e.g., "50%", "200px", "auto").

Returns

The EmailColumn object, allowing for method chaining.

Properties

public String Width { get; set; } #

Gets or sets the width of the column.

public VerticalAlignment VerticalAlign { get; set; } #

Gets or sets the vertical alignment of the column content.

public String TextAlign { get; set; } #

Gets or sets the text alignment of the column content.

public String InlineStyle { get; set; } #

Gets or sets additional inline styles for the column.

public EmailTextWrapMode WrapMode { get; set; } #

Gets or sets the text wrapping mode for controlling how text breaks and wraps in this column.