Terry,
If you have CF version 5 or newer, try putting everything in cfscript:
<table width="50" cellpadding="0" cellspacing="0">
<tr>
<td width="50" height="#total#">
<cfscript>
if ( transom is 1 )
WriteOutput("<img src=""transom.jpg"" width=""50"" height=""#x#"">");
WriteOutput("<img src=""window.jpg"" width=""50"" height=""#y#"">");
if ( kickplate is 1 )
WriteOutput("<img src=""kickplate.jpg"" width=""50"" height=""#z#"">");
<cfscript>
</td>
</tr>
</table>
Notice that you have to double-up the " marks to escape them. You can substitute
single quotes if you wish, like so: WriteOutput( "<img src='window.jpg' width-'50'
height='#y#'>" );
No whitespace is ever generated between cfscript tags unless you explicitly place
whitespace in a WriteOutput call, like this: WriteOutput(" spaces").
For more info on cfscript, Macromedia's Developing ColdFusion Applications book has a
chapter on it. It's called "Extending ColdFusion Pages with CFML Scripting" in the
book for CF 5. I don't have the CFMX book handy so I'm not sure where it is in that
edition.
Good day,
Mike Mertsock
Alfred University Web Team
>I an trying to dynamically build an html table and draw
>wall modules and am having a problem with html or CF
>adding extra space between images.
>
>Here is an simplistic example:
>
><cfset x = 40><cfset y = 100><cfset z = 50><cfset total = x+y+z>
>
><table width="50" cellpadding="0" cellspacing="0">
><tr>
><td width="50" height="#total#">
><cfif transom is 1>
> <img src="transom.jpg" width="50" height = "#x#">
></cfif>
><img src="window.jpg" width-"50" height="#y#">
><cfif kickplate is 1>
> <img src="kickplate.jpg" width="50" height = "#z#">
></cfif>
></td>
></tr>
></table>
>
>When this table displays there is space between
>each of the three images above and below
>
>If I condense the table into ONE line of code
>the spacing goes away and the pictures connect
>perfectly together with ZERO spacing period.
>
><table width="50" cellpadding="0" cellspacing="0"><tr><td width="50"
>height="#total#"><cfif transom is 1> <img src="transom.jpg" width="50"
>height = "#x#"></cfif><img src="window.jpg" width-"50" height="#y#"><cfif
>kickplate is 1><img src="kickplate.jpg" width="50" height =
>"#z#"></cfif></td></tr></table>
>
>It makes modifying the code or reading it a royal pain.
>
>Any help would be appreciated.
>
>Terry Troxel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Get the mailserver that powers this list at
http://www.coolfusion.com