Macromedia coldfusion 4.5-cfml language reference User Manual

Page of 608
292
CFML Language Reference 
CJustify
Centers a string in the specified field length.
See also 
LJustify
 and 
RJustify
.
Syntax
Cjustify(
string, length)
string
Any string to be centered.
length
Length of field.
Examples
<!--- This example shows how to use CJustify --->
<CFPARAM NAME="jstring" DEFAULT="">
<CFIF IsDefined("FORM.justifyString")>
<CFSET jstring = Cjustify("#FORM.justifyString#", 35)>
</CFIF>
<HTML>
<HEAD>
<TITLE>
CJustify Example
</TITLE>
</HEAD>
<BODY BGCOLOR=silver>
<H3>CJustify</H3>
<P>Enter a string, and it will be center justified within
the sample field
<FORM ACTION="cjustify.cfm" METHOD="POST">
<P><INPUT TYPE="Text" VALUE="<CFOUTPUT>#jString#</CFOUTPUT>" size=35 
NAME="justifyString">
<P><INPUT TYPE="Submit" NAME=""> <INPUT TYPE="RESET">
</FORM>
</BODY>
</HTML>