HtmlForgeX

API Reference

Class

EmailKeyValueTable

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email
Base Element
Implements

Simple key/value table for emails (e.g., invoice details, account info).

Inheritance

Constructors

Methods

AddRow 2 overloads
public EmailKeyValueTable AddRow(String key, String value) #
Returns: EmailKeyValueTable

Adds a row. When value is null, the row is treated as a nullable value and will respect NullValueMode.

Parameters

key System.String requiredposition: 0
value System.String requiredposition: 1
public EmailKeyValueTable AddRow(Action<EmailKeyValueRow> configure) #
Returns: EmailKeyValueTable

Adds a row configured via callback.

Parameters

configure System.Action{HtmlForgeX.Email.EmailKeyValueRow} requiredposition: 0
public EmailKeyValueTable AddRowBool(String key, Boolean value, String trueText = "Yes", String falseText = "No") #
Returns: EmailKeyValueTable

Adds a row with a boolean value (Yes/No by default).

Parameters

key System.String requiredposition: 0
value System.Boolean requiredposition: 1
trueText System.String = "Yes" optionalposition: 2
falseText System.String = "No" optionalposition: 3
public EmailKeyValueTable AddRowBoolStatus(String key, Boolean value, String trueText = "Yes", String falseText = "No", EmailStatusTone trueTone = Success, EmailStatusTone falseTone = Danger) #
Returns: EmailKeyValueTable

Adds a row with a compact boolean status (dot + Yes/No by default) without raw HTML.

Parameters

key System.String requiredposition: 0
value System.Boolean requiredposition: 1
trueText System.String = "Yes" optionalposition: 2
falseText System.String = "No" optionalposition: 3
trueTone HtmlForgeX.Email.EmailStatusTone = Success optionalposition: 4
falseTone HtmlForgeX.Email.EmailStatusTone = Danger optionalposition: 5
AddRowBytes 2 overloads
public EmailKeyValueTable AddRowBytes(String key, Nullable<Int64> bytes, Int32 decimals = 2, EmailBytesUnitSystem unitSystem = Binary, CultureInfo culture = null) #
Returns: EmailKeyValueTable

Adds a row with a byte-size formatted value.

Parameters

key System.String requiredposition: 0
bytes System.Int64 requiredposition: 1
decimals System.Int32 = 2 optionalposition: 2
unitSystem HtmlForgeX.Email.EmailBytesUnitSystem = Binary optionalposition: 3
culture System.Globalization.CultureInfo = null optionalposition: 4
AddRowBytes(System.String key, System.Nullable{System.Int64} bytes, System.Int32 decimals, HtmlForgeX.Email.EmailBytesUnitSystem unitSystem, System.Globalization.CultureInfo culture) #

Adds a row with a byte-size formatted value (nullable).

Parameters

key System.String required
bytes System.Nullable{System.Int64} required
decimals System.Int32 required
unitSystem HtmlForgeX.Email.EmailBytesUnitSystem required
culture System.Globalization.CultureInfo required
AddRowCompactNumber 2 overloads
public EmailKeyValueTable AddRowCompactNumber(String key, Nullable<Int64> value, Int32 decimals = 1, EmailCompactNumberCase suffixCase = Lower, CultureInfo culture = null) #
Returns: EmailKeyValueTable

Adds a row with a compact-number formatted value.

Parameters

key System.String requiredposition: 0
value System.Int64 requiredposition: 1
decimals System.Int32 = 1 optionalposition: 2
suffixCase HtmlForgeX.Email.EmailCompactNumberCase = Lower optionalposition: 3
culture System.Globalization.CultureInfo = null optionalposition: 4
AddRowCompactNumber(System.String key, System.Nullable{System.Int64} value, System.Int32 decimals, HtmlForgeX.Email.EmailCompactNumberCase suffixCase, System.Globalization.CultureInfo culture) #

Adds a row with a compact-number formatted value (nullable).

Parameters

key System.String required
value System.Nullable{System.Int64} required
decimals System.Int32 required
suffixCase HtmlForgeX.Email.EmailCompactNumberCase required
culture System.Globalization.CultureInfo required
AddRowDate 4 overloads
public EmailKeyValueTable AddRowDate(String key, Nullable<DateTimeOffset> value, String format = "MMM d, yyyy", CultureInfo culture = null) #
Returns: EmailKeyValueTable

Adds a row with a date-formatted value.

Parameters

key System.String requiredposition: 0
value System.DateTime requiredposition: 1
format System.String = "MMM d, yyyy" optionalposition: 2
culture System.Globalization.CultureInfo = null optionalposition: 3
AddRowDate(System.String key, System.Nullable{System.DateTime} value, System.String format, System.Globalization.CultureInfo culture) #

Adds a row with a date-formatted value (nullable).

Parameters

key System.String required
value System.Nullable{System.DateTime} required
format System.String required
culture System.Globalization.CultureInfo required
AddRowDate(System.String key, System.DateTimeOffset value, System.String format, System.Globalization.CultureInfo culture) #

Adds a row with a date-formatted value.

Parameters

key System.String required
value System.DateTimeOffset required
format System.String required
culture System.Globalization.CultureInfo required
AddRowDate(System.String key, System.Nullable{System.DateTimeOffset} value, System.String format, System.Globalization.CultureInfo culture) #

Adds a row with a date-formatted value (nullable).

Parameters

key System.String required
value System.Nullable{System.DateTimeOffset} required
format System.String required
culture System.Globalization.CultureInfo required
AddRowDateTime 4 overloads
public EmailKeyValueTable AddRowDateTime(String key, Nullable<DateTimeOffset> value, String format = "MMM d, yyyy · h:mm tt", CultureInfo culture = null) #
Returns: EmailKeyValueTable

Adds a row with a date+time formatted value.

Parameters

key System.String requiredposition: 0
value System.DateTime requiredposition: 1
format System.String = "MMM d, yyyy · h:mm tt" optionalposition: 2
culture System.Globalization.CultureInfo = null optionalposition: 3
AddRowDateTime(System.String key, System.Nullable{System.DateTime} value, System.String format, System.Globalization.CultureInfo culture) #

Adds a row with a date+time formatted value (nullable).

Parameters

key System.String required
value System.Nullable{System.DateTime} required
format System.String required
culture System.Globalization.CultureInfo required
AddRowDateTime(System.String key, System.DateTimeOffset value, System.String format, System.Globalization.CultureInfo culture) #

Adds a row with a date+time formatted value.

Parameters

key System.String required
value System.DateTimeOffset required
format System.String required
culture System.Globalization.CultureInfo required
AddRowDateTime(System.String key, System.Nullable{System.DateTimeOffset} value, System.String format, System.Globalization.CultureInfo culture) #

Adds a row with a date+time formatted value (nullable).

Parameters

key System.String required
value System.Nullable{System.DateTimeOffset} required
format System.String required
culture System.Globalization.CultureInfo required
AddRowDuration 2 overloads
public EmailKeyValueTable AddRowDuration(String key, Nullable<TimeSpan> duration, Int32 maxParts = 2) #
Returns: EmailKeyValueTable

Adds a row with a duration-formatted value.

Parameters

key System.String requiredposition: 0
duration System.TimeSpan requiredposition: 1
maxParts System.Int32 = 2 optionalposition: 2
AddRowDuration(System.String key, System.Nullable{System.TimeSpan} duration, System.Int32 maxParts) #

Adds a row with a duration-formatted value (nullable).

Parameters

key System.String required
duration System.Nullable{System.TimeSpan} required
maxParts System.Int32 required
public EmailKeyValueTable AddRowEmailAddress(String key, String email, String text = null) #
Returns: EmailKeyValueTable

Adds a row with an email address rendered as a mailto link (no raw HTML required).

Parameters

key System.String requiredposition: 0
email System.String requiredposition: 1
text System.String = null optionalposition: 2
public EmailKeyValueTable AddRowEnum<TEnum>(String key, Nullable<TEnum> value, Boolean humanize = true) #
Returns: EmailKeyValueTable

Type Parameters

TEnum

Parameters

key String requiredposition: 0
value TEnum requiredposition: 1
humanize Boolean = true optionalposition: 2
AddRowEnum``1 2 overloads
AddRowEnum``1(System.String key, ``0 value, System.Boolean humanize) #

Adds a row with an enum value (optionally humanized).

Parameters

key System.String required
value ``0 required
humanize System.Boolean required
AddRowEnum``1(System.String key, System.Nullable{``0} value, System.Boolean humanize) #

Adds a row with an enum value (nullable, optionally humanized).

Parameters

key System.String required
value System.Nullable{``0} required
humanize System.Boolean required
public EmailKeyValueTable AddRowHash(String key, String hash, Boolean breakAll = true) #
Returns: EmailKeyValueTable

Adds a row with a hash/checksum value rendered in monospace.

Parameters

key System.String requiredposition: 0
hash System.String requiredposition: 1
breakAll System.Boolean = true optionalposition: 2
public EmailKeyValueTable AddRowHashCompact(String key, String hash, Int32 head = 12, Int32 tail = 8, String ellipsis = "…") #
Returns: EmailKeyValueTable

Adds a row with a hash/checksum value rendered in monospace and truncated in the middle.

Parameters

key System.String requiredposition: 0
hash System.String requiredposition: 1
head System.Int32 = 12 optionalposition: 2
tail System.Int32 = 8 optionalposition: 3
ellipsis System.String = "…" optionalposition: 4
public EmailKeyValueTable AddRowId(String key, String id, Boolean breakAll = true) #
Returns: EmailKeyValueTable

Adds a row with an ID-like value rendered in monospace.

Parameters

key System.String requiredposition: 0
id System.String requiredposition: 1
breakAll System.Boolean = true optionalposition: 2
public EmailKeyValueTable AddRowIdCompact(String key, String id, Int32 head = 10, Int32 tail = 6, String ellipsis = "…") #
Returns: EmailKeyValueTable

Adds a row with an ID-like value rendered in monospace and truncated in the middle.

Parameters

key System.String requiredposition: 0
id System.String requiredposition: 1
head System.Int32 = 10 optionalposition: 2
tail System.Int32 = 6 optionalposition: 3
ellipsis System.String = "…" optionalposition: 4
public EmailKeyValueTable AddRowIpAddress(String key, String ipAddress) #
Returns: EmailKeyValueTable

Adds a row with an IP address rendered in monospace.

Parameters

key System.String requiredposition: 0
ipAddress System.String requiredposition: 1
AddRowItem 3 overloads
public EmailKeyValueRow AddRowItem(String key, String value) #
Returns: EmailKeyValueRow

Adds a row and returns it for further configuration (monospace values, links, etc.).

Parameters

key System.String requiredposition: 0
value System.String requiredposition: 1
public EmailKeyValueRow AddRowItem(Action<EmailKeyValueRow> configure) #
Returns: EmailKeyValueRow

Adds a row with an empty value and returns it for further configuration.

Parameters

key System.String requiredposition: 0
AddRowItem(System.Action{HtmlForgeX.Email.EmailKeyValueRow} configure) #

Adds a row configured via callback and returns it for further configuration.

Parameters

configure System.Action{HtmlForgeX.Email.EmailKeyValueRow} required
AddRowMoney 2 overloads
public EmailKeyValueTable AddRowMoney(String key, Nullable<Decimal> amount, String currencySymbol = "$", Int32 decimals = 2, CultureInfo culture = null) #
Returns: EmailKeyValueTable

Adds a row with a currency-formatted value.

Parameters

key System.String requiredposition: 0
amount System.Decimal requiredposition: 1
currencySymbol System.String = "$" optionalposition: 2
decimals System.Int32 = 2 optionalposition: 3
culture System.Globalization.CultureInfo = null optionalposition: 4
AddRowMoney(System.String key, System.Nullable{System.Decimal} amount, System.String currencySymbol, System.Int32 decimals, System.Globalization.CultureInfo culture) #

Adds a row with a currency-formatted value (nullable).

Parameters

key System.String required
amount System.Nullable{System.Decimal} required
currencySymbol System.String required
decimals System.Int32 required
culture System.Globalization.CultureInfo required
AddRowNumber 2 overloads
public EmailKeyValueTable AddRowNumber(String key, Nullable<Decimal> value, Int32 decimals = 0, CultureInfo culture = null) #
Returns: EmailKeyValueTable

Adds a row with a number-formatted value.

Parameters

key System.String requiredposition: 0
value System.Decimal requiredposition: 1
decimals System.Int32 = 0 optionalposition: 2
culture System.Globalization.CultureInfo = null optionalposition: 3
AddRowNumber(System.String key, System.Nullable{System.Decimal} value, System.Int32 decimals, System.Globalization.CultureInfo culture) #

Adds a row with a number-formatted value (nullable).

Parameters

key System.String required
value System.Nullable{System.Decimal} required
decimals System.Int32 required
culture System.Globalization.CultureInfo required
AddRowPercent 2 overloads
public EmailKeyValueTable AddRowPercent(String key, Nullable<Decimal> percent, Int32 decimals = 0, CultureInfo culture = null) #
Returns: EmailKeyValueTable

Adds a row with a percent-formatted value (expects percent units, e.g. 12.3 => "12.3%").

Parameters

key System.String requiredposition: 0
percent System.Decimal requiredposition: 1
decimals System.Int32 = 0 optionalposition: 2
culture System.Globalization.CultureInfo = null optionalposition: 3
AddRowPercent(System.String key, System.Nullable{System.Decimal} percent, System.Int32 decimals, System.Globalization.CultureInfo culture) #

Adds a row with a percent-formatted value (nullable, expects percent units).

Parameters

key System.String required
percent System.Nullable{System.Decimal} required
decimals System.Int32 required
culture System.Globalization.CultureInfo required
public EmailKeyValueTable AddRowPhoneNumber(String key, String phoneNumber, String text = null) #
Returns: EmailKeyValueTable

Adds a row with a phone number rendered as a tel link (no raw HTML required).

Parameters

key System.String requiredposition: 0
phoneNumber System.String requiredposition: 1
text System.String = null optionalposition: 2
AddRowRelativeTime 2 overloads
public EmailKeyValueTable AddRowRelativeTime(String key, Nullable<DateTimeOffset> when, Nullable<DateTimeOffset> now = null) #
Returns: EmailKeyValueTable

Adds a row with a relative-time formatted value.

Parameters

key System.String requiredposition: 0
when System.DateTimeOffset requiredposition: 1
now System.Nullable{System.DateTimeOffset} = null optionalposition: 2
AddRowRelativeTime(System.String key, System.Nullable{System.DateTimeOffset} when, System.Nullable{System.DateTimeOffset} now) #

Adds a row with a relative-time formatted value (nullable).

Parameters

key System.String required
when System.Nullable{System.DateTimeOffset} required
now System.Nullable{System.DateTimeOffset} required
public EmailKeyValueTable AddRowStatus(String key, String label, EmailStatusTone tone = Neutral, String meta = "", String href = null) #
Returns: EmailKeyValueTable

Adds a row with a compact status value (dot + label + optional meta) without raw HTML.

Parameters

key System.String requiredposition: 0
label System.String requiredposition: 1
tone HtmlForgeX.Email.EmailStatusTone = Neutral optionalposition: 2
meta System.String = "" optionalposition: 3
href System.String = null optionalposition: 4
AddRowTime 4 overloads
public EmailKeyValueTable AddRowTime(String key, Nullable<DateTimeOffset> value, String format = "h:mm tt", CultureInfo culture = null) #
Returns: EmailKeyValueTable

Adds a row with a time-formatted value.

Parameters

key System.String requiredposition: 0
value System.DateTime requiredposition: 1
format System.String = "h:mm tt" optionalposition: 2
culture System.Globalization.CultureInfo = null optionalposition: 3
AddRowTime(System.String key, System.Nullable{System.DateTime} value, System.String format, System.Globalization.CultureInfo culture) #

Adds a row with a time-formatted value (nullable).

Parameters

key System.String required
value System.Nullable{System.DateTime} required
format System.String required
culture System.Globalization.CultureInfo required
AddRowTime(System.String key, System.DateTimeOffset value, System.String format, System.Globalization.CultureInfo culture) #

Adds a row with a time-formatted value.

Parameters

key System.String required
value System.DateTimeOffset required
format System.String required
culture System.Globalization.CultureInfo required
AddRowTime(System.String key, System.Nullable{System.DateTimeOffset} value, System.String format, System.Globalization.CultureInfo culture) #

Adds a row with a time-formatted value (nullable).

Parameters

key System.String required
value System.Nullable{System.DateTimeOffset} required
format System.String required
culture System.Globalization.CultureInfo required
public EmailKeyValueTable AddRowUrl(String key, String url, String text = null) #
Returns: EmailKeyValueTable

Adds a row with a URL value rendered as a link (no raw HTML required).

Parameters

key System.String requiredposition: 0
url System.String requiredposition: 1
text System.String = null optionalposition: 2
RegisterLibraries() #

Registers required libraries for EmailKeyValueTable.

public override String ToString() #
Returns: String
public EmailKeyValueTable WithFixedLayout(Boolean enabled = true) #
Returns: EmailKeyValueTable

Enables/disables fixed table layout. Fixed layout improves Outlook rendering of long values but can change sizing behavior.

Parameters

enabled System.Boolean = true optionalposition: 0
public EmailKeyValueTable WithMobileStackedBreakpoint(Int32 px) #
Returns: EmailKeyValueTable

Sets the mobile breakpoint (px) for the stacked layout. Supported values: 480, 560, 600.

Parameters

px System.Int32 requiredposition: 0
public EmailKeyValueTable WithMobileStackedLayout(Boolean enabled = true) #
Returns: EmailKeyValueTable

Enables/disables the stacked mobile layout.

Parameters

enabled System.Boolean = true optionalposition: 0
public EmailKeyValueTable WithMobileStackedRowGap(Int32 px) #
Returns: EmailKeyValueTable

Sets the spacing (px) between key and value in the stacked mobile layout.

Parameters

px System.Int32 requiredposition: 0
public EmailKeyValueTable WithMonospaceValues() #
Returns: EmailKeyValueTable

Renders values in monospace font (useful for IDs/hashes).

public EmailKeyValueTable WithNullValueMode(EmailNullValueMode mode, String placeholder = null) #
Returns: EmailKeyValueTable

Controls how nullable/optional values are rendered (empty, placeholder, or skip row).

Parameters

mode HtmlForgeX.Email.EmailNullValueMode requiredposition: 0
placeholder System.String = null optionalposition: 1
public EmailKeyValueTable WithValueAlignment(Alignment alignment) #
Returns: EmailKeyValueTable

Sets value alignment.

Parameters

alignment HtmlForgeX.Email.Alignment requiredposition: 0

Properties

public List<EmailKeyValueRow> Rows { get; } #

Rows.

public String KeyFontFamily { get; set; } #

Font family for the key column.

public String ValueFontFamily { get; set; } #

Font family for the value column.

public String KeyWidth { get; set; } #

Key column width (optional).

public String RowPadding { get; set; } #

Row padding.

public String KeyColor { get; set; } #

Key color.

public String ValueColor { get; set; } #

Value color.

public String KeyFontSize { get; set; } #

Key font size.

public String ValueFontSize { get; set; } #

Value font size.

public Alignment ValueAlignment { get; set; } #

Value alignment (defaults to right).

public EmailNullValueMode NullValueMode { get; set; } #

How null values should be rendered.

public String NullValuePlaceholder { get; set; } #

Placeholder used when NullValueMode is Placeholder.

public Boolean RowDividers { get; set; } #

Whether to draw a subtle divider between rows.

public String DividerColor { get; set; } #

Divider color.

public Boolean UseFixedLayout { get; set; } #

When enabled, uses table-layout: fixed to avoid long values widening columns in Outlook clients. Disable to restore content-driven sizing behavior.

public Boolean UseMobileStackedLayout { get; set; } #

When enabled, renders an alternate stacked layout for narrow screens. Note: this doubles the HTML output because both layouts are emitted for CSS-based switching.

public Int32 MobileStackedBreakpointPx { get; set; } #

Breakpoint (in px) at which the stacked mobile layout is shown. Supported values: 480, 560, 600.

public Int32 MobileStackedRowGapPx { get; set; } #

Extra spacing (px) between key and value in the stacked mobile layout.