Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
CGI::HtmlExtension#caption
caption(align = {}) { || ... }
lib/cgi/html.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/cgi/html.rb, line 154
def caption(align = {}) # :yield:
attributes = if align.kind_of?(String)
{ "ALIGN" => align }
else
align
end
super(attributes)
end
Generate a Table Caption element as a string.
align can be a string, giving the alignment of the caption (one of top, bottom, left, or right). It can be a hash of all the attributes of the element. Or it can be omitted.
The body of the element is provided by the passed-in no-argument block.
Example
caption("left") { "Capital Cities" } # => <CAPTION ALIGN=\"left\">Capital Cities</CAPTION>