Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Arithmetic Sum in HTML table

Status
Not open for further replies.

gkdog

Technical User
Dec 8, 2002
34
AU
Does anyone know how to display a table in HTML where the bottom line sums (arithmetic) all the rows above it ?

GD
 
I would assume you would need to incorporate some sort of scripting for this, e.g. JavaScript

:)
 
gkdog,

HTML won't allow you to do any sort of actuive computation such as this, so you're going to need to do some sort of scripting. I do calculations on my page


so you might want to open that code up and take a look at what I do. It's one of those rare cases I didn't use an external JS file.

Good luck!
[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
I'm guessing that the data is dynamic (asp?) or you could just total it now. The easiest way to total it would be in the server-side script that generated the page. (The way that is the most fun would be to use the javascript DOM to parse the table data and display the results) Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048
Tek-Tips Best Practices: FAQ183-3179
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top