API Reference
EmailTable
Represents an email-compatible table component for displaying structured data.
Inheritance
- Element
- EmailTable
Constructors
public EmailTable() #Initializes a new instance of the EmailTable class.
public EmailTable(IEnumerable<Object> data) #Initializes a new instance of the EmailTable class with data.
Parameters
- data System.Collections.Generic.IEnumerable{System.Object}
- The data collection to populate the table.
Methods
public EmailTable AddHeader(String text, Alignment align, Int32 colspan = 1) #EmailTableAdds a header to the table.
Parameters
- text System.String
- The header text.
- align System.String = "left"
- The text alignment.
- colspan System.Int32 = 1
- The column span.
Returns
The EmailTable object, allowing for method chaining.
public EmailTable AddHeader(String text, String align, Int32 colspan, String width, String mobileText) #EmailTableAdds a header to the table with optional width and mobile text.
Parameters
- text System.String
- align System.String
- colspan System.Int32
- width System.String
- mobileText System.String
public EmailTable AddHeader(params EmailTableHeader[] headers) #EmailTableAdds a header to the table using a preconfigured header object.
Parameters
- header HtmlForgeX.Email.EmailTableHeader
AddHeader(HtmlForgeX.Email.EmailTableHeader[] headers) #Adds multiple headers to the table using preconfigured header objects.
Parameters
- headers HtmlForgeX.Email.EmailTableHeader[]
AddHeader(System.String text, HtmlForgeX.Email.Alignment align, System.Int32 colspan) #Adds a header to the table with strongly-typed alignment.
Parameters
- text System.String
- align HtmlForgeX.Email.Alignment
- colspan System.Int32
public EmailTable AddHeader(params String[] headers) #EmailTableAdds multiple headers to the table.
Parameters
- headers System.String[]
- The header texts.
Returns
The EmailTable object, allowing for method chaining.
public EmailTableRow AddRow(Action<EmailTableRow> config) #EmailTableRowAdds a row to the table.
Parameters
- cells System.String[]
- The cell values for the row.
Returns
The EmailTableRow that was added.
AddRow(System.Action{HtmlForgeX.Email.EmailTableRow} config) #Adds a row to the table using a configuration action.
Parameters
- config System.Action{HtmlForgeX.Email.EmailTableRow}
- The configuration action for the row.
Returns
The EmailTableRow that was added.
public override Void EvaluateLayout(LayoutContext context) #VoidApplies default border radius for the table.
Parameters
- context HtmlForgeX.Email.LayoutContext
- Layout evaluation context.
public EmailTable PopulateFromData(IEnumerable<IDictionary<String, Object>> data, Boolean transpose = false) #EmailTablePopulates the table from a data collection (object version for backwards compatibility).
Type Parameters
- T
Parameters
- data System.Collections.Generic.IEnumerable{System.Object}
- The data collection to populate from.
- transpose System.Boolean = false
- Whether to transpose rows and columns.
Returns
The EmailTable object, allowing for method chaining.
PopulateFromData(System.Collections.Generic.IEnumerable{System.Collections.Generic.IDictionary{System.String,System.Object}} data, System.Boolean transpose) #Populates the table from dictionaries.
Parameters
- data System.Collections.Generic.IEnumerable{System.Collections.Generic.IDictionary{System.String,System.Object}}
- Collection of dictionaries where keys are headers.
- transpose System.Boolean
- Whether to transpose rows and columns.
Returns
The EmailTable object.
PopulateFromData``1(System.Collections.Generic.IEnumerable{``0} data, System.Boolean transpose) #Populates the table from a data collection.
Type Parameters
- T
- The type of objects in the data collection.
Parameters
- data System.Collections.Generic.IEnumerable{``0}
- The data collection to populate from.
- transpose System.Boolean
- Whether to transpose rows and columns.
Returns
The EmailTable object, allowing for method chaining.
RegisterLibraries() #Registers required libraries for EmailTable.
public override String ToString() #StringConverts the EmailTable to its HTML representation.
Returns
HTML string representing the email table.
TransposeInternal() #Transposes headers and rows.
public EmailTable WithAutoMobileStackedLayout(Boolean enabled = true) #EmailTableEnables/disables automatic mobile stacked layout for wide tables.
Parameters
- enabled System.Boolean = true
public EmailTable WithAutoMobileStackedMinColumns(Int32 columns) #EmailTableSets the minimum column count required to auto-enable stacked layout.
Parameters
- columns System.Int32
public EmailTable WithBorderRadius(String radius) #EmailTableSets the border radius for the table.
Parameters
- radius System.String
- CSS radius value.
Returns
The table instance.
public EmailTable WithBorders(Boolean include = true, String color = "#e2e8f0") #EmailTableSets the table borders (fluent API).
Parameters
- include System.Boolean = true
- Whether to include borders.
- color System.String = "#e2e8f0"
- The border color.
Returns
The EmailTable object, allowing for method chaining.
public EmailTable WithCellPadding(EmailTablePadding padding) #EmailTableSets the cell padding using semantic values.
Parameters
- padding HtmlForgeX.Email.EmailTablePadding
- The padding level to apply.
Returns
The EmailTable object, allowing for method chaining.
public EmailTable WithConditionalFormatting(Action<EmailTableConditionalFormatting> configure) #EmailTableConfigures conditional formatting for the table.
Parameters
- configure System.Action{HtmlForgeX.Email.EmailTableConditionalFormatting}
- Configuration action for conditional formatting.
Returns
The EmailTable object, allowing for method chaining.
public EmailTable WithCustomCellPadding(String padding) #EmailTableSets custom cell padding values.
Parameters
- padding System.String
- CSS padding string (e.g., "10px 15px").
Returns
The EmailTable object, allowing for method chaining.
public EmailTable WithFixedLayout(Boolean enabled = true) #EmailTableEnables/disables fixed table layout. Fixed layout improves Outlook rendering of long values but can change sizing behavior.
Parameters
- enabled System.Boolean = true
WithMargin(HtmlForgeX.Email.EmailSpacing spacing) #Sets the table margin using predefined spacing values.
Parameters
- spacing HtmlForgeX.Email.EmailSpacing
- The predefined spacing value for all sides.
Returns
The EmailTable object, allowing for method chaining.
public EmailTable WithMargin(EmailSpacing vertical, EmailSpacing horizontal) #EmailTableSets the table margin using predefined spacing values for vertical and horizontal.
Parameters
- vertical HtmlForgeX.Email.EmailSpacing
- The predefined vertical spacing (top and bottom).
- horizontal HtmlForgeX.Email.EmailSpacing
- The predefined horizontal spacing (left and right).
Returns
The EmailTable object, allowing for method chaining.
public EmailTable WithMargin(EmailSpacing top, EmailSpacing right, EmailSpacing bottom, EmailSpacing left) #EmailTableSets the table margin using predefined spacing values for all sides.
Parameters
- top HtmlForgeX.Email.EmailSpacing
- The predefined top spacing.
- right HtmlForgeX.Email.EmailSpacing
- The predefined right spacing.
- bottom HtmlForgeX.Email.EmailSpacing
- The predefined bottom spacing.
- left HtmlForgeX.Email.EmailSpacing
- The predefined left spacing.
Returns
The EmailTable object, allowing for method chaining.
public EmailTable WithMobileStackedBreakpoint(Int32 px) #EmailTableSets the mobile breakpoint (px) for the stacked layout. Supported values: 480, 560, 600.
Parameters
- px System.Int32
public EmailTable WithMobileStackedLabelWidth(String width) #EmailTableSets the label column width for the stacked mobile layout (e.g. "35%" or "140px").
Parameters
- width System.String
public EmailTable WithMobileStackedLayout(Boolean enabled = true) #EmailTableEnables/disables the mobile stacked layout for narrow screens.
Parameters
- enabled System.Boolean = true
public EmailTable WithMobileStackedRowGap(Int32 px) #EmailTableSets the spacing (px) between label/value rows in the stacked mobile layout.
Parameters
- px System.Int32
public EmailTable WithRounded() #EmailTableApplies a medium border radius to the table.
Returns
The table instance.
public EmailTable WithRoundedBorderSpacing(Int32 horizontalSpacing = 16) #EmailTableEnables email-safe spacing for tables with rounded borders. Uses cell-specific padding patterns that work reliably in all email clients.
Parameters
- horizontalSpacing System.Int32 = 16
- Additional horizontal spacing in pixels (default: 16).
Returns
The EmailTable object, allowing for method chaining.
public virtual EmailTable WithRoundingMode(RoundingMode mode) #EmailTableSets the rounding mode for this table.
Parameters
- mode HtmlForgeX.Email.RoundingMode
- Rounding mode.
Returns
The table instance.
public EmailTable WithStriped(Boolean striped = true, String color = "#f1f5f9") #EmailTableSets striped rows (fluent API).
Parameters
- striped System.Boolean = true
- Whether to stripe rows.
- color System.String = "#f1f5f9"
- The stripe color.
Returns
The EmailTable object, allowing for method chaining.
public EmailTable WithStyle(EmailTableStyle style) #EmailTableSets the table style with predefined styling (fluent API consistent with other components).
Parameters
- style HtmlForgeX.Email.EmailTableStyle
- The predefined table style.
Returns
The EmailTable object, allowing for method chaining.
Inherited Methods
public override Element Add(Element element) #ElementParameters
- element Element
public override Element AddCssClass(String cssClass) #ElementParameters
- cssClass String
public EmailActivityList EmailActivityList() #EmailActivityListParameters
- config Action<EmailActivityList>
public EmailAddressBlock EmailAddressBlock() #EmailAddressBlockParameters
- config Action<EmailAddressBlock>
public EmailAddressCard EmailAddressCard() #EmailAddressCardParameters
- config Action<EmailAddressCard>
public EmailAlert EmailAlert(EmailAlertType type, String title, String message = "") #EmailAlertParameters
- config Action<EmailAlert>
public EmailArticleCard EmailArticleCard() #EmailArticleCardParameters
- config Action<EmailArticleCard>
public EmailArticleList EmailArticleList() #EmailArticleListParameters
- config Action<EmailArticleList>
public EmailAttachmentList EmailAttachmentList() #EmailAttachmentListParameters
- config Action<EmailAttachmentList>
public EmailAvatar EmailAvatar(String initials, String size = "40px") #EmailAvatarParameters
- config Action<EmailAvatar>
public EmailAvatarStack EmailAvatarStack() #EmailAvatarStackParameters
- config Action<EmailAvatarStack>
public EmailBackgroundImageBox EmailBackgroundImageBox() #EmailBackgroundImageBoxParameters
- config Action<EmailBackgroundImageBox>
public EmailBadge EmailBadge(String text, String backgroundColor = "#64748B", String color = "#FFFFFF") #EmailBadgeParameters
- config Action<EmailBadge>
public EmailBadgeList EmailBadgeList() #EmailBadgeListParameters
- config Action<EmailBadgeList>
public EmailBarChart EmailBarChart() #EmailBarChartParameters
- config Action<EmailBarChart>
public EmailBarcode EmailBarcode(String value) #EmailBarcodeParameters
- config Action<EmailBarcode>
public Element EmailBlockquote(Action<EmailBlockquote> config) #ElementParameters
- content String = ""
public Element EmailBox(Action<EmailBox> config) #ElementParameters
- config Action<EmailBox>
public Element EmailBoxWithBuilder(Action<EmailBoxBuilder> config) #ElementParameters
- config Action<EmailBoxBuilder>
public EmailBrandStrip EmailBrandStrip() #EmailBrandStripParameters
- config Action<EmailBrandStrip>
public Element EmailButton(Action<EmailButton> config) #ElementParameters
- config Action<EmailButton>
public EmailButtonGroup EmailButtonGroup() #EmailButtonGroupParameters
- config Action<EmailButtonGroup>
public EmailCalendar EmailCalendar() #EmailCalendarParameters
- config Action<EmailCalendar>
public EmailCalloutCard EmailCalloutCard() #EmailCalloutCardParameters
- config Action<EmailCalloutCard>
public EmailChangelog EmailChangelog() #EmailChangelogParameters
- config Action<EmailChangelog>
public Element EmailColumn(Action<EmailColumn> config) #ElementParameters
- config Action<EmailColumn>
public EmailCommentList EmailCommentList() #EmailCommentListParameters
- config Action<EmailCommentList>
public EmailComparisonTable EmailComparisonTable() #EmailComparisonTableParameters
- config Action<EmailComparisonTable>
public Element EmailContent(Action<EmailContent> config) #ElementParameters
- config Action<EmailContent>
public EmailCredentialCard EmailCredentialCard() #EmailCredentialCardParameters
- config Action<EmailCredentialCard>
public EmailDateStrip EmailDateStrip() #EmailDateStripParameters
- config Action<EmailDateStrip>
public Element EmailDivider(Action<EmailDivider> config) #ElementParameters
- config Action<EmailDivider>
public EmailDnsRecordsTable EmailDnsRecordsTable() #EmailDnsRecordsTableParameters
- config Action<EmailDnsRecordsTable>
public EmailDonutChart EmailDonutChart() #EmailDonutChartParameters
- config Action<EmailDonutChart>
public EmailDownloadCard EmailDownloadCard() #EmailDownloadCardParameters
- config Action<EmailDownloadCard>
public EmailEmojiRating EmailEmojiRating() #EmailEmojiRatingParameters
- config Action<EmailEmojiRating>
public EmailEmptyStateCard EmailEmptyStateCard() #EmailEmptyStateCardParameters
- config Action<EmailEmptyStateCard>
public EmailEventCard EmailEventCard() #EmailEventCardParameters
- config Action<EmailEventCard>
public EmailFaqList EmailFaqList() #EmailFaqListParameters
- config Action<EmailFaqList>
public EmailFeatureList EmailFeatureList() #EmailFeatureListParameters
- config Action<EmailFeatureList>
public Element EmailHeading(Action<EmailHeading> config) #ElementParameters
- content String = ""
- level Int32 = 2
public EmailHeatmap EmailHeatmap() #EmailHeatmapParameters
- config Action<EmailHeatmap>
public EmailHero EmailHero() #EmailHeroParameters
- config Action<EmailHero>
public EmailIconCircle EmailIconCircle() #EmailIconCircleParameters
- config Action<EmailIconCircle>
public EmailImage EmailImage(String source, String width) #EmailImageParameters
- config Action<EmailImage>
public EmailIncidentSummaryCard EmailIncidentSummaryCard() #EmailIncidentSummaryCardParameters
- config Action<EmailIncidentSummaryCard>
public EmailInlineStack EmailInlineStack() #EmailInlineStackParameters
- config Action<EmailInlineStack>
public EmailInvoiceLineItemsTable EmailInvoiceLineItemsTable() #EmailInvoiceLineItemsTableParameters
- config Action<EmailInvoiceLineItemsTable>
public EmailInvoiceTotals EmailInvoiceTotals() #EmailInvoiceTotalsParameters
- config Action<EmailInvoiceTotals>
public EmailKeyValueTable EmailKeyValueTable() #EmailKeyValueTableParameters
- config Action<EmailKeyValueTable>
public EmailKpiDelta EmailKpiDelta() #EmailKpiDeltaParameters
- config Action<EmailKpiDelta>
public EmailLineBreak EmailLineBreak(String height) #EmailLineBreakParameters
- height String
public EmailLineItemsTable EmailLineItemsTable() #EmailLineItemsTableParameters
- config Action<EmailLineItemsTable>
public Element EmailLink(Action<EmailLink> config) #ElementParameters
- content String
- href String
public Element EmailList(Action<EmailList> config) #ElementParameters
- config Action<EmailList>
public EmailMapCard EmailMapCard() #EmailMapCardParameters
- config Action<EmailMapCard>
public EmailMediaObject EmailMediaObject() #EmailMediaObjectParameters
- config Action<EmailMediaObject>
public EmailMessageThread EmailMessageThread() #EmailMessageThreadParameters
- config Action<EmailMessageThread>
public EmailMetricTile EmailMetricTile(String value, String label, String icon = "") #EmailMetricTileParameters
- config Action<EmailMetricTile>
public EmailNpsRating EmailNpsRating() #EmailNpsRatingParameters
- config Action<EmailNpsRating>
public EmailOfferCard EmailOfferCard() #EmailOfferCardParameters
- config Action<EmailOfferCard>
public EmailOtpCode EmailOtpCode(String code) #EmailOtpCodeParameters
- config Action<EmailOtpCode>
public EmailPhotoCard EmailPhotoCard() #EmailPhotoCardParameters
- config Action<EmailPhotoCard>
public EmailPhotoGrid EmailPhotoGrid() #EmailPhotoGridParameters
- config Action<EmailPhotoGrid>
public EmailPricingTable EmailPricingTable() #EmailPricingTableParameters
- config Action<EmailPricingTable>
public EmailProductCard EmailProductCard() #EmailProductCardParameters
- config Action<EmailProductCard>
public EmailProductGrid EmailProductGrid() #EmailProductGridParameters
- config Action<EmailProductGrid>
public EmailProfileCard EmailProfileCard() #EmailProfileCardParameters
- config Action<EmailProfileCard>
public EmailProgressBar EmailProgressBar(Int32 value) #EmailProgressBarParameters
- config Action<EmailProgressBar>
public EmailProjectList EmailProjectList() #EmailProjectListParameters
- config Action<EmailProjectList>
public EmailPromoCodeCard EmailPromoCodeCard() #EmailPromoCodeCardParameters
- config Action<EmailPromoCodeCard>
public EmailQrCode EmailQrCode(String value) #EmailQrCodeParameters
- config Action<EmailQrCode>
public EmailReceiptCard EmailReceiptCard() #EmailReceiptCardParameters
- config Action<EmailReceiptCard>
public EmailRepoStatsCard EmailRepoStatsCard() #EmailRepoStatsCardParameters
- config Action<EmailRepoStatsCard>
public EmailReviewStars EmailReviewStars() #EmailReviewStarsParameters
- config Action<EmailReviewStars>
public EmailReviewSummary EmailReviewSummary() #EmailReviewSummaryParameters
- config Action<EmailReviewSummary>
public Element EmailRow(Action<EmailRow> config) #ElementParameters
- config Action<EmailRow>
public EmailScheduleCard EmailScheduleCard() #EmailScheduleCardParameters
- config Action<EmailScheduleCard>
public EmailScheduleList EmailScheduleList() #EmailScheduleListParameters
- config Action<EmailScheduleList>
public EmailShippingProgress EmailShippingProgress() #EmailShippingProgressParameters
- config Action<EmailShippingProgress>
public EmailSocialLinks EmailSocialLinks() #EmailSocialLinksParameters
- config Action<EmailSocialLinks>
public Element EmailSpacer(Action<EmailSpacer> config) #ElementParameters
- height String
public EmailSparklineBars EmailSparklineBars(params Int32[] values) #EmailSparklineBarsParameters
- config Action<EmailSparklineBars>
public EmailStatCard EmailStatCard(String title, String value, String subtitle = "", String delta = "", EmailTrendDirection trend = Neutral) #EmailStatCardParameters
- config Action<EmailStatCard>
public EmailStatusTimeline EmailStatusTimeline() #EmailStatusTimelineParameters
- config Action<EmailStatusTimeline>
public EmailStepsIndicator EmailStepsIndicator() #EmailStepsIndicatorParameters
- config Action<EmailStepsIndicator>
public EmailStoreBadges EmailStoreBadges() #EmailStoreBadgesParameters
- config Action<EmailStoreBadges>
public EmailSubscriptionSummaryCard EmailSubscriptionSummaryCard() #EmailSubscriptionSummaryCardParameters
- config Action<EmailSubscriptionSummaryCard>
public EmailSurveyOptions EmailSurveyOptions() #EmailSurveyOptionsParameters
- config Action<EmailSurveyOptions>
public Element EmailTable<T>(IEnumerable<T> data, Action<EmailDynamicTable<T>> config) #ElementType Parameters
- T
Parameters
- config Action<EmailTable>
public Element EmailText(Action<EmailText> config) #ElementParameters
- content String = ""
public EmailTextBlock EmailTextBlock() #EmailTextBlockParameters
- config Action<EmailTextBlock>
public EmailTodoList EmailTodoList() #EmailTodoListParameters
- config Action<EmailTodoList>
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
public override Element WithCssClass(String cssClass) #ElementSets the CSS class (fluent API).
Parameters
- cssClass System.String
- The CSS class to apply.
Returns
The EmailTable object, allowing for method chaining.
public override Element WithMargin(String margin) #ElementSets the table margin for better spacing.
Parameters
- margin System.String
- CSS margin string (e.g., "0 16px").
Returns
The EmailTable object, allowing for method chaining.
public override Element WithPadding(String padding) #ElementSets the table padding (spacing inside the table wrapper). Only applied when UseWrapper is true.
Parameters
- padding System.String
- The padding value (e.g., "16px", "8px 16px").
Returns
The EmailTable object, allowing for method chaining.
Properties
public List<EmailTableHeader> Headers { get; set; } #Gets or sets the table headers.
public List<EmailTableRow> Rows { get; set; } #Gets or sets the table rows.
public Boolean IncludeBorders { get; set; } #Gets or sets whether to include borders.
public String BorderColor { get; set; } #Gets or sets the border color.
public Boolean StripedRows { get; set; } #Gets or sets whether to stripe alternate rows.
public String StripeColor { get; set; } #Gets or sets the stripe color.
public String HeaderStyle { get; set; } #Gets or sets the header style.
public String CellStyle { get; set; } #Gets or sets the cell style.
public Boolean ThemeAwareDefaults { get; set; } #When enabled, default table colors (border/stripe/header/cell text) follow the per-email Theme palette. Custom styles and explicit colors are preserved.
public EmailTableConditionalFormatting ConditionalFormatting { get; set; } #Gets or sets the conditional formatting rules.
public EmailTablePadding CellPadding { get; set; } #Gets or sets the padding level for table cells.
public String CustomCellPadding { get; set; } #Gets or sets custom cell padding (overrides CellPadding enum). Format: "vertical horizontal" (e.g., "10px 15px")
public Boolean UseWrapper { get; set; } #Gets or sets whether to use a wrapper for better spacing. When true, wraps the table in an additional table with padding.
public Int32 ExtraHorizontalSpacing { get; set; } #Gets or sets extra horizontal spacing for rounded border tables (email-safe approach). Applied as additional padding to first and last cells in each row.
public String BorderRadius { get; set; } #Gets or sets the border radius for the table. Default is no rounded corners.
public Boolean UseFixedLayout { get; set; } #When enabled, uses table-layout: fixed to prevent long cell values from causing overflow/overlap in Outlook. Disable to restore content-driven sizing behavior.
public Boolean UseMobileStackedLayout { get; set; } #When enabled, renders an alternate stacked layout for narrow screens. The desktop table is hidden on small screens while the stacked version is shown. Note: this doubles the HTML output because both layouts are emitted for CSS-based switching.
public Boolean AutoMobileStackedLayout { get; set; } #When enabled, automatically switches to stacked layout on mobile for wide tables.
public Int32 AutoMobileStackedLayoutMinColumns { get; set; } #Minimum column count required to enable auto-stacked layout.
public String MobileStackedLabelWidth { get; set; } #Label column width for the stacked mobile layout (e.g. "35%" or "140px").
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 stacked label/value rows inside a mobile card.
public virtual RoundingMode RoundingMode { get; set; } #Controls how rounding is applied when no explicit radius is set.