os_caption


A caption or title.

An os_caption is a caption for an element like os_table . An os_caption can contain text, text markup containers, and elements like os_image and os_hyperlink .

Elements are inserted into os_caption through either the add() member function or operator<< .

os_caption can be aligned at the top, bottom, left, or right of its target element. Alignment can be specified in the constructor or through the align() member function. Note that the alignment specification supports a feature proposed for HTML 3.0 and may not be supported by all browsers.

Declaration

#include <ospace/web/caption.h>
class os_caption : public os_element_group

Enums

enum os_caption::alignment
  {
  top,     // Places the caption above the table.
  bottom,  // Places the caption below the table.
  left,    // Places the caption to the left of the table.
  right    // Places the caption to the right of the table.
  };

Interface

Constructor
os_caption()
Constructs an empty caption.
Constructor
os_caption( alignment align )
Constructs an empty caption with alignment align .
Constructor
os_caption( const os_element& element )
Constructs a caption containing a copy of element .
Constructor
os_caption( const os_element& element , alignment align )
Constructs a caption containing a copy of element , with alignment align .
Constructor
os_caption( const string& text )
Constructs a caption containing an os_text element created from text .
Constructor
os_caption( const string& text , alignment align )
Constructs a caption containing an os_text element created from text , with alignment align .
align
os_caption& align( alignment align )
Sets the alignment to align and returns a reference to the caption.
align
int align() const
Returns the alignment, or os_element::use_default if not set.
clone
/* virtual */ os_element* clone() const
Returns a base class pointer to a heap-based deep copy of the caption.
print
/* virtual */ void print( ostream& os ) const
Prints the caption to os .

Copyright©1994-2026 Recursion Software LLC
All Rights Reserved