Hi

This may not be a php matter but i'm wondering if it can be done?

I have a table like the following:

<table>
<tr>
<td>1</td>
<td>2</td>
</tr>

<tr>
<td>7</td>
<td>9</td>
</tr>

<tr>
<td><<SUM OF THIS COLUMN (8)>></td>
<td><<SUM OF THIS COLUMN(11)>></td>
</tr>
</table>

I hope you understand what it is im asking. This is easy to do in mysql however can it be done in standard html/dhtml ?

Thanks

if the data values were populated by PHP and the HTML gnerated by PHP, the sums can be calculated with a for loop.

if this is just a plain HTML somefile.html, then at best you can use clientside scripting like javascript to traverse the table DOM and get the .value of the td, do a sum and then set the .value again for the final row.

just with html its not possible use javascript or php for calculation. if you need help about javascript or php calculation let me know.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.