Column Sum Returns NaN
Column Sum Returns NaN
Please I have an issue with my datatable. I have gotten the code to sum numerical columns and display the total in the footer of the datatable.
Problem is, it displays a column total of NaN when there is a <span></span> element within the <td></td> containing the numerical value I want to sum.
See the live example here: http://live.datatables.net/wideqali/1068/edit?html,js,output
You can see the other columns show a proper total in the footer.
Now I'm having the span issue because when I use a datatable in my project, the HTML markup becomes like this:
<td style="width: 8%; text-align: right;"><span id = "MainContent_adv_bal_repeater_non_admin_Label11_2"> 80,000.00</span></td>
This prevents the footer from return a total.
This question has an accepted answers - jump to answer
Answers
You will need to remove the HTML tags. You can use a regex replace for this. Something like this:
http://live.datatables.net/wideqali/1069/edit
Kevin
Thank you so much Kevin. It worked nice. I spent hours battling with this.