htmlCenter
Object centering class
[Previous] [Main] [Next]


Description
htmlCenter encapsulates the <CENTER></CENTER> tags. It is used to mark regions, such as text or tables, that will be centered horizontally on the display.  
 
Some objects include an optional Align() method that specifies the alignment of an object. However, htmlCenter lets you easily center a block of  
content without having to specify the alignment of each object. It also lets you center elements, such as images, and arbitrary content that could not otherwise be centered (such as entire tables). The Align() method of an object overrides htmlCenter.  
 
Declaration
#include <dcmicro/htmlpp/styles.h>  
 
Hierarchy
htmlcenter.gif  
 
See Also
Text Formatting Classes in the User's Guide  
 
Related Constants/Definitions
None.  
 
Constructors
htmlCenter()  
Constructs an empty object.  
 
htmlCenter( const htmlObject& element )  
Constructs an object, inserting element into it.  
 
htmlCenter( const String& text )  
Constructs an object, inserting the string text into it.  
 
Destructor
virtual ~htmlCenter()  
Destroys the object.  
 
Example Use
 
#include <stdio.h>  
#include <stdlib.h>  
#include <dcmicro/htmlpp/htmlpp.h>  
 
int main( void )  
{  
   htmlCgi   server ;  
   htmlPage  page( "html++ example application" ) ;  
 
   page << "This text is "  
        << htmlBreak()  
        << htmlCenter( "centered." )  
        << htmlBreak() ;  
 
   server << page ;  
   return 0 ;  
}  
 
Program Output
 
Content-Type: text/html  
<HTML>  
<HEAD>  
<TITLE>html++ example application</TITLE>  
</HEAD>  
<BODY>  
This text is <BR>  
<CENTER>centered.</CENTER>  
<BR>  
</BODY>  
</HTML>  
 
center.gif  





©1998 DC Micro Development. All rights reserved.
No portion of this document may be c opied or reproduced without expressed written consent.
html++ is a trademark of DC Micro Development.