ColdFusion Data in the box
Author: junaidi musa @ @ junaidix™
JUNAIDIX™ Laboratories
 
File: boxfunction.cfm
Usage: Copy and paste in a file and include the file within the template.
 
<cfscript>
////------------------------------------------------------------////
/// display data in the box/table representation in ColdFusion
/// author : junaidi musa @ junaidix™
/// created: 24.Feb.2004
/// usage : #outbox("sample data",1,15)#
/// output : [S][A][M][P][L][E][ ][D][A][T][A][ ][ ][ ][ ]
/// param : data - string/data want to display in the box cell
/// row - number of rows of the box
/// col - number of column of the box
/// Modified by hairiemx on 24 March 2004
////------------------------------------------------------------////
function outbox(data,row,col)
{
inbox = true;

if(inbox)
{
datarray = ArrayNew(1);
mydata = trim(data);
datalength = len(mydata);
for(i = 1; i lte datalength; i = i + 1)
{
datarray[i] = Mid(mydata,i,Len(mydata));
}

element = 1;
WriteOutput("<table cellpadding=0 cellspacing=1 border=0 bgcolor='black'>");
for(r = 1; r lte row; r = r + 1)
{
WriteOutput("<tr>");
for(c = 1; c lte col; c = c + 1)
{
WriteOutput("<td width=14 bgcolor='white'><div align=center><font size=2>");
if(element lte datalength)
WriteOutput(Ucase( Left(datarray[element],1) ));
else
WriteOutput("&nbsp;");
WriteOutput("</font></div></td>");
element = element + 1;
}
WriteOutput("</tr>");
}
WriteOutput("</table>");
}
else
{
WriteOutput(data);
}
}
< /cfscript>


Copyright © 2004 JUNAIDIX™ Laboratories
Hosted by www.Geocities.ws

1