Class Caption


@Bean(typeName="caption") public class Caption extends HtmlElementMixed
DTO for an HTML <caption> element.

The caption element represents the title of a table. It is used to provide a brief description or title for the table content, making it easier for users to understand what the table contains. The caption element should be placed as the first child of a table element and is typically rendered above the table by default.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple table caption Caption simple = caption("Monthly Sales Report"); // Table caption with styling Caption styled = caption("Employee Directory") ._class("table-title"); // Table caption with complex content Caption complex = caption( "Sales Data for ", strong("Q1 2024"), " - ", em("Preliminary Results") ); // Table caption with links Caption withLinks = caption( "Product Inventory - ", a("/help/inventory", "Help"), " | ", a("/export/inventory", "Export") ); // Table caption with icons Caption withIcons = caption( "📊 ", "Financial Summary", " ", span()._class("icon").children("💰") ); // Table caption with multiple lines Caption multiLine = caption( "Customer Contact Information", br(), "Last Updated: ", time("2024-01-15", "January 15, 2024") );

The following convenience methods are provided for constructing instances of this bean:

See Also: