Class MjSection
java.lang.Object
dev.jcputney.mjml.component.BaseComponent
dev.jcputney.mjml.component.BodyComponent
dev.jcputney.mjml.component.body.AbstractSectionComponent
dev.jcputney.mjml.component.body.MjSection
The section component (<mj-section>). Renders a table-based row containing columns with
responsive behavior. Handles full-width sections, background colors/images, padding, and MSO
conditional column layout.
-
Field Summary
Fields inherited from class AbstractSectionComponent
registryFields inherited from class BaseComponent
globalContext, node, renderContext -
Constructor Summary
ConstructorsConstructorDescriptionMjSection(MjmlNode node, GlobalContext globalContext, RenderContext renderContext, ComponentRegistry registry) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddInnerTdBorderStyles(Map<String, String> styles) Adds border styles to the inner td style map.protected voidaddInnerTdPaddingOverrides(Map<String, String> styles) Adds individual padding overrides.doubleReturns the content width after subtracting padding and borders.Returns the default attribute values for this component.Returns the MJML tag name this component handles.render()Renders this component to HTML.Methods inherited from class AbstractSectionComponent
addInnerTdExtraStyles, buildBackgroundCss, buildBgImageDivStyle, buildBgImageTableStyle, buildInnerTableStyle, buildInnerTdStyle, buildOuterDivStyle, getBoxModel, getCssClass, hasBackgroundUrl, renderNormalScaffold, resolveBackgroundPositionMethods inherited from class BodyComponent
addBorderStyles, addIfPresent, addIfPresent, buildAttributes, buildResponsiveClass, buildStyle, escapeAttr, escapeHref, getChildrenByTags, orderedMap, parseWidth, registerMediaQuery, renderChildren, resolveShorthandSide, sanitizeContent, sanitizeHrefMethods inherited from class BaseComponent
getAttribute, getAttribute, getNode
-
Constructor Details
-
MjSection
public MjSection(MjmlNode node, GlobalContext globalContext, RenderContext renderContext, ComponentRegistry registry)
-
-
Method Details
-
getContentWidth
public double getContentWidth()Description copied from class:BodyComponentReturns the content width after subtracting padding and borders.- Overrides:
getContentWidthin classBodyComponent- Returns:
- the content width in pixels
-
getTagName
Description copied from class:BaseComponentReturns the MJML tag name this component handles.- Specified by:
getTagNamein classBaseComponent- Returns:
- the MJML tag name
-
getDefaultAttributes
Description copied from class:BaseComponentReturns the default attribute values for this component.- Specified by:
getDefaultAttributesin classBaseComponent- Returns:
- a map of attribute names to their default values
-
render
Description copied from class:BodyComponentRenders this component to HTML.- Specified by:
renderin classBodyComponent- Returns:
- the rendered HTML string
-
addInnerTdBorderStyles
Description copied from class:AbstractSectionComponentAdds border styles to the inner td style map. Default implementation adds only the "border" attribute if non-empty and not "none". Subclasses can override to use the full addBorderStyles() helper.- Overrides:
addInnerTdBorderStylesin classAbstractSectionComponent- Parameters:
styles- the mutable style map to add border properties to
-
addInnerTdPaddingOverrides
Description copied from class:AbstractSectionComponentAdds individual padding overrides. Default is no-op.- Overrides:
addInnerTdPaddingOverridesin classAbstractSectionComponent- Parameters:
styles- the mutable style map to add padding overrides to
-