Spudhead
05-29-2003, 03:47 PM
Hey,
The following code displays various "features" paragraphs associated with a product. Each product may have all, some or none of the features - I hope the code is fairly self-explanatory:
<%
if strOpinion<>"" then strOpinion="<span class=""subhead"">Our opinion</span><br>"&strOpinion
if strWSG<>"" then strWSG="<span class=""subhead"">World snowboard guide</span><br>"&strWSG
if strApres<>"" then strApres="<span class=""subhead"">Après ski</span><br>"&strApres
if strActivities<>"" then strActivities="<span class=""subhead"">Activities</span><br>"&strActivities
if strPriceCheck<>"" then strPriceCheck="<span class=""subhead"">Price check</span><br>"&strPriceCheck
if strTransfers<>"" then strTransfers="<br><br><span class=""subhead"">Transfers</span><br>"&strTransfers
if strSnowSavers<>"" then strSnowSavers="<span class=""subhead"">Snow savers</span><br>"&strSnowSavers
%>
<table cellpadding=10 cellspacing=0 border=0>
<tr>
<td width="50%" class="body" valign="top"><%=strOpinion%></td>
<td width="50%" class="body" valign="top"><%=strWSG%></td>
</tr>
<tr>
<td width="50%" class="body" valign="top"><%=strApres%></td>
<td width="50%" class="body" valign="top"><%=strActivities%></td>
</tr>
<tr>
<td width="50%" class="body" valign="top"><%=strPriceCheck%><%=strTransfers%></td>
<td width="50%" class="body" valign="top"><%=strSnowSavers%></td>
</tr>
</table>
The problem is that, while achieving the desired two-column layout, the code above produces empty table cells - and hence poorly laid out copy - if features aren't there for a particular product.
What I'd like is to adopt a CSS layout that will produce two columns of equal width and fairly equal height, using only the features paragraphs available for the product.
This may - probably will - involve some ASP re-coding as well as any CSS implementation, as the copy is coming out of a database, but I thought I'd stick it in here first; it can be moved later if required.
Thanks for any suggestions....
The following code displays various "features" paragraphs associated with a product. Each product may have all, some or none of the features - I hope the code is fairly self-explanatory:
<%
if strOpinion<>"" then strOpinion="<span class=""subhead"">Our opinion</span><br>"&strOpinion
if strWSG<>"" then strWSG="<span class=""subhead"">World snowboard guide</span><br>"&strWSG
if strApres<>"" then strApres="<span class=""subhead"">Après ski</span><br>"&strApres
if strActivities<>"" then strActivities="<span class=""subhead"">Activities</span><br>"&strActivities
if strPriceCheck<>"" then strPriceCheck="<span class=""subhead"">Price check</span><br>"&strPriceCheck
if strTransfers<>"" then strTransfers="<br><br><span class=""subhead"">Transfers</span><br>"&strTransfers
if strSnowSavers<>"" then strSnowSavers="<span class=""subhead"">Snow savers</span><br>"&strSnowSavers
%>
<table cellpadding=10 cellspacing=0 border=0>
<tr>
<td width="50%" class="body" valign="top"><%=strOpinion%></td>
<td width="50%" class="body" valign="top"><%=strWSG%></td>
</tr>
<tr>
<td width="50%" class="body" valign="top"><%=strApres%></td>
<td width="50%" class="body" valign="top"><%=strActivities%></td>
</tr>
<tr>
<td width="50%" class="body" valign="top"><%=strPriceCheck%><%=strTransfers%></td>
<td width="50%" class="body" valign="top"><%=strSnowSavers%></td>
</tr>
</table>
The problem is that, while achieving the desired two-column layout, the code above produces empty table cells - and hence poorly laid out copy - if features aren't there for a particular product.
What I'd like is to adopt a CSS layout that will produce two columns of equal width and fairly equal height, using only the features paragraphs available for the product.
This may - probably will - involve some ASP re-coding as well as any CSS implementation, as the copy is coming out of a database, but I thought I'd stick it in here first; it can be moved later if required.
Thanks for any suggestions....