I would like to add a column as seen in the image below please (marked up), i would like the column
to be the same thickness as the top section with the title and to have the same colour as the title
section, is this possible please?
Heres the code and i think it needs to be added twice, but once i know what to add and where then i will be
able to do it for the second bit
You have font tags, all kinds of echo’s, old fashioned attributes in td’s etc… and you are missing the original table info which makes it hard to see what the whole picture is.
Really hard to determine what you are trying to do there.
Suggest that you create a page, and layout what you want the table to look like with just plain HTML. After you get the structure, you can then re-add it to your page and add the variables to it.
Notice all the echo’s are gone except the first one. The lines all continue one from that one echo as it doesn’t terminate until the very last line. And you can now see the structure of the table elements. Much easier to read and understand.
If you remove the old fashioned HTML elements and use CSS, it would be even easier to read.
Then you can display the page, use something like FF with WebDev and set the CSS to what you want seeing the changes as you make the changes. Save the resulting CSS that looks okay, and put it in your style sheet.
Try this for starters. It outputs a table like the one you describe. Interestingly I did not realise that you could use the echo command with single quotes to encapsulate the output and therefore keep the double quotes in the html You learn something new every day!
<?php
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" colspan="2" align="center" bgcolor="#3F3F3F"><font color="#CCCCCC">This is your title</font></td>
<td width="25" rowspan="2" bgcolor="#3F3F3F"> </td>
</tr>
<tr>
<td width="58" align="center">Your image goes here</td>
<td align="center" bgcolor="#FFFFC6">Snow Risk Title
Day 1 Snow
Day 2 Snow
etc etc
</td>
</tr>
</table>';
?>
Thanks Wellington but sadly i do not see how i can use that because the snow risk
script is all automatic, I have been having a play with my exisint code today but i still
cannot get it to add the column
I have actually had another play and managed to acheive what i was wanting by copying
this code from the original script and placing it correctly
It makes reading the source a bit easier and is a lot easier. It is a lot easier to read than doing it the other way where you use <?php echo $xxx; ?> throughout the HTML.
Hi Kevin, yes its the WXSim Risk Assessment script, but the snow part that i have on my
front page is what i have modified from the original because i wanted something that would
just show a snow risk and nothing else, i also use the normal script for all risks on my WXSim
forecast page.
I used to have a section on my main page where i used to manually add the snow risk 2 or 3
times daily, but it was a pain having to do this and i wanted something that was automatic
and i was pointed to the script.
I did want it to look like my manually added script but i was not able to modify it to that extreme
so i had to compromise
This is what i used to have, it does look nicer and easier to read at a glance
Looking at you initial post, would I be right in saying the information you wish to include is in the variable: $rsklst[$i]
If so could you add a loop to add the information in the table cell. If you finish the echo after the title then write php add $rsklst[$i]."
"; Once finished continue with a new echo to finish the table