Skip to main content
Inspiring
October 22, 2008
Question

How can I put this into a table

  • October 22, 2008
  • 1 reply
  • 249 views
I have the following code inside a table.

<table border="0" width="760">
<tr>
<td class="TitleText">
<cfoutput query="qrySerialNumbers" group="materialNumber"><b>Material Number:</b> #materialNumber#<p>
<cfloop from="1" to="#quantity#" index="i">
<cfif #len(i)# is 1>
<b>Serial Number #i#:</b>    <cfinput type="text" name="serialNumber" required="Yes" Message="Serial Number must be entered."><input type="hidden" name="gfmPartNumberID" value="#gfmPartNumberID#"><br>
<cfelse>
<b>Serial Number #i#:</b>  <cfinput type="text" name="serialNumber" required="Yes" Message="Serial Number must be entered."><input type="hidden" name="gfmPartNumberID" value="#gfmPartNumberID#"><br>
</cfif>
</cfloop>
<p>
</cfoutput>
</td>
</tr>
</table>

It gives me the desired output layout and the data is correct.

But I want to put in the <td> and <tr> tags to make each line a proper table format so that I can control the spacing, instead of using   The output layout should be the same as what I have now.

I cannot seem to get this to work.
    This topic has been closed for replies.

    1 reply

    Inspiring
    October 22, 2008
    You currently have the entire query being outputted inside a single table cell.

    You might want something like this:
    <table>
    <cfoutput query="something" group ="whatever">
    <tr><td>#grouped data#</td>
    <td><cfoutput>#ungrouped data#<br></td>
    </tr>
    </cfoutput>
    </table>