本文介绍了使用javascript的列总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 i使用如下代码创建了一个html表。 Hi, i created a html table using the code as below. var sString = ""; sString += "<table cellpadding='4' cellspacing='0' class='tableGgrid_' style='text-align: center;width: 100%;'>"; sString += "<tr class='HeaderCell'>"; sString += "<td style='border-width: 1px; width:5%; border-right-style: solid;"; sString += "border-bottom-style: solid; border-color: #4B6C9E;' align='left'>"; sString += "normalText">no"; sString += "</td>"; sString += "<td style='removed: pointer; border-width: 1px; width: 19%; border-right-style: solid;"; sString += "border-bottom-style: solid; border-color: #4B6C9E;' align='left'>"; sString += "normalText">Employee Name"; sString += "</td>"; sString += "<td style=' removed: pointer; border-width: 1px; width: 14%; border-right-style: solid;"; sString += "border-bottom-style: solid; border-color: #4B6C9E;' align='left'>"; sString += "normalText">Employee ID"; sString += "</tr>"; for(i=0;i<oTable.Rows.length;i++) { sString += "<tr class='" + sClass + "' >"; sString += "<td style='border-width: 1px; border-right-style: solid;"; sString += "border-bottom-style: solid; border-color: #4B6C9E;' align='left'>"; sString += "<span class='wordwrap'>" +i + "</span>"; sString += "</td>"; sString += "<td style='border-width: 1px; border-right-style: solid;"; sString += "border-bottom-style: solid; border-color: #4B6C9E;' align='left'>"; sString += "<span class='wordwrap'>" + trimAll(oTable.Rows[i].empName.replace(/\\/gi, '\\')) + "</span>"; sString += "</td>"; sString += "<td style='border-width: 1px; border-right-style: solid;"; sString += "border-bottom-style: solid; border-color: #4B6C9E;' align='left'>"; sString += "<span class='linkText'>" + trimAll(oTable.Rows[i].cmpId) + "</span>"; sString += "</td>"; sString += "</tr>"; } sString += "</table>";document.getElementById("divAllReports").innerHTML = sString; i想要找到以上列的总和表。怎么能找到它? 谢谢.. i want to find the sum of columns of the above table. how can find it?Thanks..推荐答案 <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title></head><body> <div id="divAllReports"></div> <div id="divSum"></div> <script src="jquery.js"></script> <script type="text/javascript"> 这篇关于使用javascript的列总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-13 19:04