os_table_data
|
 |
A data cell within a table row.
An os_table_data
is a data cell within an os_table_row . An os_table_data
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_data
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_data
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/tabledat.h>
class os_table_data : public os_element_group
Enums
enum os_table_data::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 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_data()
Constructs an empty table
data cell.
Constructor
os_table_data(
alignment align ,
valignment valign )
Constructs an empty table
data cell with horizontal alignment align and
vertical alignment valign .
Constructor
os_table_data(
const os_element& element )
Constructs a table data
cell containing a copy of element.
Constructor
os_table_data(
const os_element& element ,
alignment align ,
valignment valign )
Constructs a table data
cell, containing a copy of element , with
horizontal alignment align and vertical alignment valign
.
Constructor
os_table_data(
const string& text )
Constructs a table data
cell containing an os_text element created from
text .
Constructor
os_table_data(
const string& text ,
alignment align ,
valignment valign )
Constructs a table data
cell, containing an os_text element created
from text , with horizontal alignment align
and vertical alignment valign .
align
os_table_data&
align( alignment align )
Sets the horizontal
alignment of the cell contents to align , and
returns a reference to the table data 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 data cell.
column_span
os_table_data&
column_span( int span )
Sets the number of columns
the cell spans to span , and returns a reference
to the table data cell.
column_span
int
column_span() const
Returns the number of
columns the cell spans, or 0 if not set.
disable_wrap
os_table_data&
disable_wrap()
Disables text line
wrapping within the cell and returns a reference to the table data cell.
enable_wrap
os_table_data&
enable_wrap()
Enables text line wrapping
within the cell, and returns a reference to the table data 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 data
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_data&
row_span( int span )
Sets the number of rows
the cell spans to span , and returns a reference
to the table data cell.
valign
os_table_data&
valign( valignment valign )
Sets the vertical
alignment of the cell contents to valign , and
returns a reference to the table data 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