Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8181799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:38:44+00:00 2026-06-07T00:38:44+00:00

I have an asp:table(table1), in a user control with following structure | Col2 |

  • 0

I have an asp:table(table1), in a user control with following structure


           |  Col2 | Col3 | SUM
   DEFAULT |    5  |   2  |    
      R1   |    1  |   2  |     
      R2   |    4  |   5  |  

Here only headers are created statically in aspx page, rest all rows are added in .vb(dynamically) page.

My requirement is, on page load(in client side, after table gets loaded) I want the Sum column to show sum of Col2 and Col3. Also since the Col2 and Col3 are editable, on data change in cells, the Sum values should get updated itself.

How can I find the cells, since I dont have their ID, also which events should be called to show these values ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:38:45+00:00Added an answer on June 7, 2026 at 12:38 am

    JavaScript:

        var col2,col3;
        var table = document.getElementById('tableid');
        for (var i = 0; i < table.rows.length; i++) {
            //2 - first cell number, 3 2nd cell number.
            for (var j = 2; j <= 3; j++) {
               if(j==2){//coll2
                 col1 += table.rows[i].cells[j].innerHTML;
               }else if(j==3){//col3
                 col2 += table.rows[i].cells[j].innerHTML;
               }
            }
        }
    

    You can view it as so: (maybe this will make it look simple)
    Table:
    {row:0,cell:0},{row:0,cell:1},{row:0,cell:2},{row:0,cell:3},{row:0,cell:4}
    {row:1,cell:0},{row:1,cell:1},{row:1,cell:2},{row:1,cell:3},{row:1,cell:4}
    {row:2,cell:0},{row:2,cell:1},{row:2,cell:2},{row:2,cell:3},{row:2,cell:4}
    …
    (bold values are the values you will get with the code above)
    I hope it helps, you only need the table id.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web user control with the following markup <table> <tr> <td> <h1>
I have User Control <table style=border-width: 0> <tr> <td style=vertical-align: middle;> <asp:RadioButton ID=rdOption runat=server
I have the following HTML generated by an ASP.NET repeater: <table> <tr> <td><input type=hidden
I have the following code <table cellpadding=2 cellspacing=2> <tr> <td>Factory:</td> <td> <asp:TextBox ID=txtFactory runat=server
I have a user control in my asp.net web project. It displays the title
I have dragged a empty asp.net table onto my webform. I generate all the
I have an ASP Classic page with a table. Is it possible to allow
I have an ASP.NET page and I am generating an HTML table in my
I have an ASP.Net-MVC app using LinqToSql. I have a subcontracts table, a service_lines
I have a table of results in an ASP.Net MVC page where the last

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.