I'm experimenting with adding rounded tables to my site. Rather than trying to change the existing tables, I have created functions to start and stop a table with rounded corners. I then use these functions to "wrap" my existing tables with a thin, rounded border.
<%
'##############################################
'## Rounded Tables MOD ##
'##############################################
function StartRndTables(byval Width)
If strSiteRoundedCorners = "1" then
%>
<table width=<%=Width%> border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="16"><img src="images/top_lef.gif" width="16" height="16"></td>
<td height="16" background="images/top_mid.gif"><img src="images/top_mid.gif" width="16" height="16"></td>
<td width="20"><img src="images/top_rig.gif" width="20" height="16"></td>
</tr>
<tr>
<td width="14" background="images/cen_lef.gif"><img src="images/cen_lef.gif" width="14" height="11"></td>
<td >
<%
end if
end function
function EndRndTables
If strSiteRoundedCorners = "1" then
%>
<td width="20" background="images/cen_rig.gif"><img src="images/cen_rig.gif" width="20" height="11"></td>
</tr>
<tr>
<td width="16" height="16"><img src="images/bot_lef.gif" width="16" height="16"></td>
<td height="16" background="images/bot_mid.gif"><img src="images/bot_mid.gif" width="16" height="16"></td>
<td width="20" height="16"><img src="images/bot_rig.gif" width="20" height="16"></td>
</tr>
</table>
<%
end if
End function
%>
I'm pleased with the effect, but my site has additional "themes" and although the rounded table images have transparency, they don't look good on darker backgrounds. So, I want to pull different images depending on the theme. Seems like it should be simple... use "getCurrentIcon" to display the images that correspond to the selected theme. It SHOULD be simple, but I can't get it right.
I can pull the images, but my problem is getting the top/bottom and side images to become the cell background so that it "tiles" and fills the cell, however large the table is.
The functions below are my attempt to rewrite using ASP, but of course "background" doesn't work here. Can someone help me get this right?
<%
'##############################################
'## Rounded Tables MOD ##
'##############################################
function StartRndTables(byval Width)
If strSiteRoundedCorners = "1" then
Response.write "<table width="""& Width &""" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"">" & vbnewline & _
"<tr>" & vbnewline & _
"<td width=""16"">" & getCurrentIcon(strTopLeft,"","") & "</td>" & vbnewline & _
"<td height=""16"" background=""" & getCurrentIcon(strTopMid,"","") & getCurrentIcon(strTopMid,"","") & "</td>" & vbnewline & _
"<td width=""20"">" & getCurrentIcon(strTopRight,"","") & "</td>" & vbnewline & _
"</tr>" & vbnewline & _
"<tr>" & vbnewline & _
"<td width=""14"" background=""" & getCurrentIcon(strCenLeft,"","") & getCurrentIcon(strCenLeft,"","") & "</td>" & vbnewline & _
"<td>" & vbnewline
end if
end function
function EndRndTables
If strSiteRoundedCorners = "1" then
Response.write "<td width=""20"" background=""" & getCurrentIcon(strCenRight,"","") & getCurrentIcon(strCenRight,"","") & "</td>" & vbnewline & _
"</tr>" & vbnewline & _
"<tr>" & vbnewline & _
"<td width=""16"" height=""16"">" & getCurrentIcon(strBotLeft,"","align=""absmiddle""") & "</td>" & vbnewline & _
"<td height=""16"" background=""" & getCurrentIcon(strBotMid,"","") & getCurrentIcon(strBotMid,"","") & "</td>" & vbnewline & _
"<td width=""20"" height=""16"">" & getCurrentIcon(strBotRight,"","align=""absmiddle""") & "</td>" & vbnewline & _
"</tr>" & vbnewline & _
"</table>" & vbnewline
end if
End function
%>