I looked high and low for a solution to this but since nobody seems to have ever asked this question, I assume I'm the only one who doesn't know the answer. I have a situation where I need to put an image and some text into tables on the page. Every thing is fine if I use a pixel size like <td width='170'...>. However, I'd like to use a percentage but <td width='20%'...> doesn't get it. This is within an echo statement so I have to use single quotes or escape the double quotes with a backslash. Here is the line of code I'm having trouble with.
I am in the process of creating a memorial website for my nephew. This particular code is for a page where people can light and a memorial candle. They will use a form to enter their name and a few words. When they click on a "submit" button, a candle is displayed with their name and message under it. This is why I have a table within a table. I want to have a limit of four candles per row so I have a short little routine to do that. Every thing seems to work well but I want to use a percentage so things don't get messed up for those who have wide screens.
Code:
print("<td><table border='0' width='20%'><td align='center'><img src='images/candle.gif' width='70' height='79'><br>$name</td></table></td>");
I am in the process of creating a memorial website for my nephew. This particular code is for a page where people can light and a memorial candle. They will use a form to enter their name and a few words. When they click on a "submit" button, a candle is displayed with their name and message under it. This is why I have a table within a table. I want to have a limit of four candles per row so I have a short little routine to do that. Every thing seems to work well but I want to use a percentage so things don't get messed up for those who have wide screens.