Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Break up a list into multiple lines 1

Status
Not open for further replies.

neomorpheus

Programmer
Mar 9, 2001
47
US
I have a list as below-

(SuperUser,SuperEdit,ContentEdit,Contentviewers,PageOwners,Metadata,UserAdministrators,BusinessTools,SoftwareTools,ServicesTools,InformationTech,WebReports)

I have a table that displays certain data and one of the rows in the table displays the above list. Since the list is very long, it extends the table width and I have to scroll horizontally to view the table and it doesnt look good either. The list is displayed in one single line :-(

How can i break the contents of the list in such a way that I display three elements of a list in one line and automatically break to the next line and start the fourth one and so on.

So the display would be as below:

SuperUser,SuperEdit,ContentEdit,
Contentviewers,PageOwners,Metadata,
UserAdministrators,BusinessTools,SoftwareTools,
ServicesTools,InformationTech,WebReports

That would prevent the table width from extending too far wide.

Suggestions or solutions welcome. Thanks
 
how about this:

<CFSET looplist = &quot;SuperUser,SuperEdit,ContentEdit,Contentviewers,PageOwners,Metadata,UserAdministrators,BusinessTools,SoftwareTools,ServicesTools,InformationTech,WebReports&quot;>
<CFPARAM NAME=&quot;loopindex&quot; DEFAULT=&quot;0&quot;>

<CFLOOP INDEX=&quot;i&quot; LIST=&quot;#loopList#&quot; DELIMITERS=&quot;,&quot;>
<CFSET loopindex = loopindex +1>
<cfoutput>
#i#
<cfif (loopindex MOD 3) EQ 0>
<BR>
</CFIF>
</CFOUTPUT>
</CFLOOP>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top