Ask a Question related to Coldfusion Database Access, Design and Development.
-
CRC #1
How to span a query into 2 columns
I have a query that produces a list of products and some of those products are
subdivided into groups within the list. I have a query that includes the
'Group' feature to display the products that are subdivided by their group.
This all works out fine but my problem is the list can be very long and I would
like to span the query into two columns. Attached is my code. Can anyone help
me?:confused;
<div align="left">
<table width="450" border="0" cellspacing="2" cellpadding="2">
<tr>
<th width="442" valign="top" scope="row"> <cfoutput><span
style="font-weight: bold; font-size:
larger;">#Recordset2.Products#</span></cfoutput><cfoutput query="Recordset1"
group="Subtype">
<div align="left" style="font-size: larger"> <br>#Recordset1.SubType#</div>
<cfoutput>
<div align="left"><span style="font-size:
x-small"> #Recordset1.Product#
</span><br>
</div>
</cfoutput></cfoutput><br></th><tr> </tr>
</table>
<p><strong><span class="style11"><br>
</span></strong></p>
</div>
CRC Guest
-
Arranging Query Columns
This is my query <cfset Totals = queryNew("TotalPointsEarned,EarnedPointsCost,TotalPointsRedeemed,RedeemedPointsC... -
Span rows/columns?
Is there a way to make a column in a grid span all the others? For instance I have fields Client, Address, State, City, Zip, Comments. I would... -
Specify Query Columns from From
I want to create a form where a user can select from a drop down box which query colums they want to select and in what order. The form will be... -
displaying query in 2 columns
Hi Guys, need your help on this please, I am trying to get the result of my query splited in 2 columns, where in the first column will have my first... -
DataGrid (body only) contained in <span>...</span> tags
Hi, I have a DataGrid control that displays many records. As such, I have been given a requirement to contain only the body of my DataGrid... -
CRC #2
How to span a query into 2 columns
I have a query that produces a list of products and some of those products are
subdivided into groups within the list. I have a query that includes the
'Group' feature to display the products that are subdivided by their group.
This all works out fine but my problem is the list can be very long and I would
like to span the query into two columns. Attached is my code. Can anyone help
me? :confused;
<div align="left">
<table width="450" border="0" cellspacing="2" cellpadding="2">
<tr>
<th width="442" valign="top" scope="row"> <cfoutput><span
style="font-weight: bold; font-size:
larger;">#Recordset2.Products#</span></cfoutput><cfoutput query="Recordset1"
group="Subtype">
<div align="left" style="font-size: larger"> <br>#Recordset1.SubType#</div>
<cfoutput>
<div align="left"><span style="font-size:
x-small"> #Recordset1.Product#
</span><br>
</div>
</cfoutput></cfoutput><br></th><tr> </tr>
</table>
<p><strong><span class="style11"><br>
</span></strong></p>
</div>
CRC Guest
-
CRC #3
How to span a query into 2 columns
I have a query that produces a list of products and some of those products are
subdivided into groups within the list. I have a query that includes the
'Group' feature to display the products that are subdivided by their group.
This all works out fine but my problem is the list can be very long and I would
like to span the query into two columns. Attached is my code. Can anyone help
me? :confused;
<div align="left">
<table width="450" border="0" cellspacing="2" cellpadding="2">
<tr>
<th width="442" valign="top" scope="row"> <cfoutput><span
style="font-weight: bold; font-size:
larger;">#Recordset2.Products#</span></cfoutput><cfoutput query="Recordset1"
group="Subtype">
<div align="left" style="font-size: larger"> <br>#Recordset1.SubType#</div>
<cfoutput>
<div align="left"><span style="font-size:
x-small"> #Recordset1.Product#
</span><br>
</div>
</cfoutput></cfoutput><br></th><tr> </tr>
</table>
<p><strong><span class="style11"><br>
</span></strong></p>
</div>
CRC Guest
-
Brian Hogue #4
Re: How to span a query into 2 columns
The parameter for spanning columns is "colspan". You want "colspan=2" on
some rows.
-brian
"CRC" <webforumsuser@macromedia.com> wrote in message
news:d07dsi$9a1$1@forums.macromedia.com...are> I have a query that produces a list of products and some of those productsgroup.> subdivided into groups within the list. I have a query that includes the
> 'Group' feature to display the products that are subdivided by theirwould> This all works out fine but my problem is the list can be very long and Ihelp> like to span the query into two columns. Attached is my code. Can anyonequery="Recordset1"> me? :confused;
>
> <div align="left">
> <table width="450" border="0" cellspacing="2" cellpadding="2">
> <tr>
> <th width="442" valign="top" scope="row"> <cfoutput><span
> style="font-weight: bold; font-size:
> larger;">#Recordset2.Products#</span></cfoutput><cfoutput<br>#Recordset1.SubType#</div>> group="Subtype">
> <div align="left" style="font-size: larger">> <cfoutput>
> <div align="left"><span style="font-size:
> x-small"> #Recordset1.Product#
> </span><br>
> </div>
> </cfoutput></cfoutput><br></th><tr> </tr>
> </table>
> <p><strong><span class="style11"><br>
> </span></strong></p>
> </div>
>
Brian Hogue Guest
-
CRC #5
Re: How to span a query into 2 columns
I apologize in advance for my inexperience, but where in my code do I put that. I tired putting it after 'scope='row'' but that did nothing...?
CRC Guest
-
Tteddo #6
Re: How to span a query into 2 columns
You would use 2 cfloops, an outside one that would index the row every 2
records and then 2 query loops inside that one, one for each <td>. So, every
row you would add 1 to a Row_Number variable, which would add the required <tr>
and </tr>, and also you would index 2 record variables by 2, which you would
use to snag every other record from the database and add the <td>'s Like so
<cfset Total_Rows = Total Records / 2 + 1> <cfset Row_Number = 1> <cfset
Record_One = 1> <cfset Record_Two = 2> <cfloop condition='Row_Number less than
Total_Rows'> <tr> <cfloop query='get_data' startrow='#Record_One#'
endrow='#Record_One#'> <td> #Data# </td> </cfloop> <cfloop query='get_data'
startrow='#Record_Two#' endrow='#Record_Two#'> <td> #Data# </td> </cfloop>
<cfset Row_Number = Row_Number + 1> <cfset Record_One = Record_One + 2> <cfset
Record_Two = Record_Two + 2> </cfloop>
Tteddo Guest
-
Brian Hogue #7
Re: How to span a query into 2 columns
CRC -
No need to apologize, most people need help in the beginning.
Your question is really a HTML question, not a CF question. The tags for
displaying a table are <table>, <tr> and <td>. The <td> "defines" the cell.
Since you want one cell to span two columns, that HTML tag looks like <td
colspan="2">.
I am guessing that you want to span two columns in certain instances, and in
other rows you want the two columns to appear. That sounds like some
tweaking of any CFloop and CFoutput code that you have. Have you read Ben
Forta's WACK?
-brian
"CRC" <webforumsuser@macromedia.com> wrote in message
news:d07tcb$5ts$1@forums.macromedia.com...that. I tired putting it after 'scope='row'' but that did nothing...?> I apologize in advance for my inexperience, but where in my code do I put
Brian Hogue Guest
-
CRC #8
Re: How to span a query into 2 columns
I got a response from an instructor of mine which solved my problem. Here is
is response for future reference: I am assuming that you want to place the
products into two column, e.g. Auto Dealers Auctions
Franchised Auto Dealer Implement & Equipment
Motorcycle & RV Dealership Trailer Dealers
Used Car & Truck Repair Shops Body & Paint
Mechanical Mobile Repair
Muffler Radiator Wheel Alignment
There are two approaches: 1 w/ tables, 1 w/ divs. Looking at your code, the
div solution looks better: <CFOUTPUT query='Recordset1' group='Subtype'>
<DIV align='left' style='font-size: larger'><BR>#Recordset1.SubType#</DIV>
<CFOUTPUT> <DIV align='left; font-size: x-small; width:48%;
float:left'> #Recordset1.Product#<BR> </DIV> </CFOUTPUT>
</CFOUTPUT>
CRC Guest



Reply With Quote

