os_table_header


A header cell within a table row.

An os_table_header is a header cell within an os_table_row that is used to denote header cells. An os_table_header typically renders text in a bold font, which differs from os_table_data . An initial element for the os_table_header contents can be specified in a constructor. The contents of an os_table_header are typically centered horizontally and vertically within the cell.

An os_table_header can specify the horizontal and vertical alignment of its contents in a constructor or through the align() and valign() member functions. These alignment specifications override default cell alignment specifications in the containing os_table_row .

By default, an os_table_header cell spans one column and one row, but can span multiple columns and/or multiple rows within an os_table . Cell spanning can be specified through the column_span() and row_span() member functions.

By default, text within an os_table_header cell wraps to fit the width of the cell. Text wrapping can be disabled through the disable_wrap() member function, and reenabled through the enable_wrap() member function.

Declaration

#include <ospace/web/tablehdr.h>
class os_table_header : public os_element_group

Enums

enum os_table_header::alignment
  {
  left,     // Aligns the contents horizontally against the left margin of the cell.
  center,   // Centers the contents horizontally between the left and right margins of the cell.
  right     // Aligns the contents horizontally against the right margin of the cell.
  };


enum os_table_header::valignment
  {
  top,      // Aligns the contents vertically against the top margin of the cell.
  middle,   // Centers the contents vertically between the top and bottom margins of the cell.
  bottom,   // Aligns the contents vertically against the bottom margin of the cell.
  baseline  // Aligns the contents vertically with the baseline of text in adjacent cells of the same row.
  };
	

Interface

Constructor
os_table_header()
Constructs an empty table header cell.
Constructor
os_table_header( alignment align , valignment valign )
Constructs an empty table header cell, with horizontal alignment align and vertical alignment valign .
Constructor
os_table_header( const os_element& element )
Constructs a table header cell containing a copy of element .
Constructor
os_table_header( const os_element& element , alignment align , valignment valign )
Constructs a table header cell, containing a copy of element , with horizontal alignment align and vertical alignment valign .
Constructor
os_table_header( const string& text )
Constructs a table header cell containing an os_text element created from text .
Constructor
os_table_header( const string& text , alignment align , valignment valign )
Constructs a table header cell, containing an os_text element created from text , with horizontal alignment align and vertical alignment valign .
align
os_table_header& align( alignment align )
Sets the horizontal alignment of the cell contents to align and returns a reference to the table header cell.
align
int align() const
Returns the horizontal alignment of the cell contents, 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 table header cell.
column_span
os_table_header& column_span( int span )
Sets the number of columns the cell spans to span , and returns a reference to the table header cell.
column_span
int column_span() const
Returns the number of columns the cell spans, or 0 if not set.
disable_wrap
os_table_header& disable_wrap()
Disables text line wrapping within the cell and returns a reference to the table header cell.
enable_wrap
os_table_header& enable_wrap()
Enables text line wrapping within the cell, and returns a reference to the table header cell.
no_wrap
bool no_wrap() const
Returns true if text line wrapping within the cell is disabled.
print
/* virtual */ void print( ostream& os ) const
Prints the table header cell to os .
row_span
int row_span() const
Returns the number of rows the cell spans, or 0 if not set.
row_span
os_table_header& row_span( int span )
Sets the number of rows the cell spans to span , and returns a reference to the table header cell.
valign
os_table_header& valign( valignment valign )
Sets the vertical alignment of the cell contents to valign , and returns a reference to the table header cell.
valign
int valign() const
Returns the vertical alignment of the cell contents, or os_element::use_default if not set.

Copyright©1994-2026 Recursion Software LLC
All Rights Reserved