|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Cftable
Two questions about this table... i copied it from a book
<cfquery name="cash" datasource="userlogin"> SELECT * FROM Market ORDER BY Selling </cfquery> <cftable query="cash" colheaders HTMLTABLE border="1"> <cfcol header="selling" width="10" text="#selling#"> <cfcol header="quantity" width="5" text="#quantity#"> <cfcol header="total" width="10" text="#total#"> <cfcol header="description" width="50" text="#description#"> <cfcol header="Purchase" width="5" text=<a href="dfgd.cfm">"Buy!"</a> </cftable> First off - the headers selling, quantity, total, description, and purchase don't show up. I can highlight it and see it so i know it is there.. My background is black, but the rest of the text on the page in the table show up.. the ones that are populated from database... how can i make those show up? And next - how can i make a link in the last column? I was just quessing and it didn't work :P Attribute validation error for tag CFCOL. The tag does not allow the attribute(s) HREF. The valid attribute(s) are ALIGN,HEADER,TEXT,WIDTH. |
|
#2
|
|||
|
|||
|
I've been doing CF for 7 years and I've never used the cftable tag. My advice would be to simply output the table yourself, you'll have far more control over what happens.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
Quote:
Do you mean a HTML table or just not using table format at all? |
|
#4
|
|||
|
|||
|
Yes I mean just output an HTML table yourself, and loop over the query to output each row.
<table> <tr><th>Selling</th><th>Quantity</th>...</tr> <cfoutput query="cash"> <tr><td>#cash.selling#</td><td>#cash.quantity#</td>...</tr> </cfoutput> </table> Obviously, fill it in with your other columns as needed. Also, all this sort of thing is covered in excellent detail in the Ben Forta book, I'd recommend picking it up as it is invaluable in learning CF. |
|
#5
|
|||
|
|||
|
Quote:
Ok I am trying an example off a site and it's still doing the same thing with the headers.. <TABLE border="1" summary="This table gives some statistics about fruit flies: average height and weight, and percentage with red eyes (for both males and females)."> <CAPTION><EM>A test table with merged cells</EM></CAPTION> <TR><TH rowspan="2"><TH colspan="2">Average <TH rowspan="2">Red<BR>eyes <TR><TH>height<TH>weight <TR><TH>Males<TD>1.9<TD>0.003<TD>40% <TR><TH>Females<TD>1.7<TD>0.002<TD>43% </TABLE> |
|
#6
|
|||
|
|||
|
Can you put a link in a cf table? if so what am i doing wrong
|
|
#7
|
|||
|
|||
|
If the headers aren't showing up then you've probably got issues with your style sheet or browser. Headers DO show up just fine if they are done correctly.
If you mean is it possible to put a link in a <cftable> tagset, I have no idea since I never use (I actually hate) <cftable>. If you mean can you put a link into a table that CF generates, the answer is absolutely yes. |
|
#8
|
|||
|
|||
|
Also remember you don't *have* to use <th> for the headers, you can also just output a standard row with <tr><td>My Header</td></tr>.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Cftable |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|