Coast Line
asked on
creating a custom table for Displaying the Data
Hi, I have the following string and i want to split that string to display data in table format but the way i want to display is not working, Here is the data and here is how it should look like
i want to create the above as the following table:
<table>
<tr>
<td>vendorname</td><td>#ve ndorname#< /td>
<td>city</td><td>#city#</t d>
<td>state</td><td>#state#< /td>
</tr>
<tr><td>zip</td><td>#zip#< /td>
<td> </td><td> < /td>
<td> </td><td> < /td>
</tr>
</table>
trying to create 6 columns in one TR
Here is try so far
<table align="center" width="100%" border="0" cellpadding="4" cellspacing="6" bordercolor="#CCCCCC;">
<tr>
<cfloop index="aPair" list="#Demo_Details#" delimiters=":">
<cfset Key= listFirst(aPair,"-")>
<cfif listLen(apair,"-") gt 1>
<cfset value= listLast(aPair,"-")>
<cfelse>
<cfset value = "">
</cfif>
<cfoutput>
<td><strong>#key#</strong> </td>
<td>#value#</td>
</cfoutput>
</cfloop>
</tr>
</table>
vendorname- #name#: city-#city#: state-#state#:zip-#zip#:in network-#innetwork#
i want to create the above as the following table:
<table>
<tr>
<td>vendorname</td><td>#ve
<td>city</td><td>#city#</t
<td>state</td><td>#state#<
</tr>
<tr><td>zip</td><td>#zip#<
<td> </td><td> <
<td> </td><td> <
</tr>
</table>
trying to create 6 columns in one TR
Here is try so far
<table align="center" width="100%" border="0" cellpadding="4" cellspacing="6" bordercolor="#CCCCCC;">
<tr>
<cfloop index="aPair" list="#Demo_Details#" delimiters=":">
<cfset Key= listFirst(aPair,"-")>
<cfif listLen(apair,"-") gt 1>
<cfset value= listLast(aPair,"-")>
<cfelse>
<cfset value = "">
</cfif>
<cfoutput>
<td><strong>#key#</strong>
<td>#value#</td>
</cfoutput>
</cfloop>
</tr>
</table>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yeah, that looks right. I'll check back tomorrow.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
<table ...>
<tr>
<cfset columns = 0>
<cfloop index="aPair" list="#Demo_Details#" delimiters=":">
<cfset Key= listFirst(aPair,"-")>
<cfif listLen(apair,"-") gt 1>
<cfset value= listLast(aPair,"-")>
<cfelse>
<cfset value = "">
</cfif>
<cfoutput>
<td><strong>#key#</strong>
<td>#value#</td>
</cfoutput>
<cfset columns = columns + 2>
<!--- start new row and reset --->
<cfif columns gte 6>
</tr></tr>
<cfset columns = 0>
</cfif>
</cfloop>
</tr>
</table>
i am ooo now, so will try in morning
Thanks