RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDSTableProducer.FormatCell Method

Returns an HTML tag of a specified type that reflects a set of specified options.

Pascal
function FormatCell(CellRow: Integer; CellColumn: Integer; CellData: string; const Tag: string; const BgColor: THTMLBgColor; Align: THTMLAlign; VAlign: THTMLVAlign; const Custom: string): string; dynamic;
C++
__fastcall AnsiString FormatCell(int CellRow, int CellColumn, AnsiString CellData, const AnsiString Tag, const THTMLBgColor BgColor, THTMLAlign Align, THTMLVAlign VAlign, const AnsiString Custom);

The table producer uses this protected utility to assemble a set of properties into a single HTML tag. FormatCell first generates an OnFormatCell event, so that the application can override any of the properties that control the tag options. Then it assembles the resulting values into the specified tag. 

CellRow and CellColumn identify the table cell to be formatted. These parameters are passed to an OnFormatCell event handler so that it can identify the cell. 

CellData contains the text displayed in the cell (a data value or column header). 

Tag indicates the type of HTML tag to generate (<TD> for data cells, <TH> for column headers). 

BgColor specifies the background color of the cell. An OnFormatCell event handler can override this value. 

Align specifies the horizontal alignment of CellData within the cell. An OnFormatCell event handler can override this value. 

VAlign specifies the vertical alignment of CellData within the cell. An OnFormatCell event handler can override this value. 

Custom specifies any other options for the generated HTML tag. An OnFormatCell event handler can override this value. 

FormatCell returns a string with the generated HTML tag. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!