0
각 테이블 셀 (첫 번째 $ 기호를 건너 뛰기)에서 비용을 들여 전체 테이블을 $ 기호로 표시하는 onload 스크립트를 만들려고합니다. 그것은 "console.log (합계);" 올바른 합계 값을 반환하지만 이상한 결과가 나옴 NaN 결과가 전체 셀에 나타납니다. 어떤 아이디어? 아래를 봐주세요.마지막 셀에 표시되는 열 셀의 Jquery 합계
<table id="BookTable" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="33%" scope="col"><h4>Title</h4></th>
<th width="18%" scope="col"><h4>Author</h4></th>
<th width="15%" scope="col"><h4>Publisher</h4></th>
<th width="6%" scope="col"><h4>Year</h4></th>
<th width="13%" scope="col"><h4>Cover Artist</h4></th>
<th width="9%" scope="col"><h4>Genre</h4></th>
<th width="6%" scope="col"><h4>Cost</h4></th>
</tr>
<tr>
<td width="33%">And Kill Once More </td>
<td width="18%">Al Fray </td>
<td width="15%">Graphic Mystery (1st)</td>
<td width="6%">1955</td>
<td width="13%">Saul Levine </td>
<td width="9%">Mystery</td>
<td width="6%" class="cost">$7.11</td>
</tr>
<tr>
<td width="33%">The Big Sleep</td>
<td width="18%">Raymond Chandler </td>
<td width="15%">New Avon Library (1st)</td>
<td width="6%">1943 </td>
<td width="13%">Paul Stahr </td>
<td width="9%">Mystery</td>
<td width="6%" class="cost">$43.88</td>
</tr>
<tr>
<td width="33%">The Insidious Doctor Fu Manchu</td>
<td width="18%">Sax Rohmer </td>
<td width="15%">Pyramid (1st)</td>
<td width="6%">1961 </td>
<td width="13%">Mort Engle </td>
<td width="9%">Mystery</td>
<td width="6%" class="cost">$1.69</td>
</tr>
<tr>
<td width="33%">The Window At The White Cat</td>
<td width="18%">Mary Roberts Rinehart</td>
<td width="15%">Dell (1st)</td>
<td width="6%">1938</td>
<td width="13%">Gerald Gregg</td>
<td width="9%">Mystery</td>
<td width="6%" class="cost">$12</td>
</tr>
<tr>
<td width="33%">Steve Bentley's Calypso Caper </td>
<td width="18%">Robert Dietrich</td>
<td width="15%">Dell (1st)</td>
<td width="6%">1961 </td>
<td width="13%">Tom Miller </td>
<td width="9%">Mystery</td>
<td width="6%" class="cost">$7</td>
</tr>
<tr>
<td width="33%">Dead Man's Diary and a Taste for Cognac</td>
<td width="18%">Brett Halliday</td>
<td width="15%">Dell (1st)</td>
<td width="6%">1964</td>
<td width="13%">Robert McGinnis</td>
<td width="9%">Mystery</td>
<td width="6%" class="cost">$2</td>
</tr>
<tr>
<td width="33%">House of Darkness</td>
<td width="18%">Allan MacKinnon</td>
<td width="15%">Dell (1st)</td>
<td width="6%">1947</td>
<td width="13%">Gerald Gregg</td>
<td width="9%">Mystery</td>
<td width="6%" class="cost">$3</td>
</tr>
<tr>
<td width="33%">The Panic Stricken</td>
<td width="18%">Mitchell Wilson</td>
<td width="15%">Dell (1st)</td>
<td width="6%">1948 </td>
<td width="13%">Gerald Gregg?</td>
<td width="9%">Mystery</td>
<td width="6%" class="cost">$6</td>
</tr>
<tr>
<td width="33%"> Hang By Your Neck</td>
<td width="18%">Henry kane</td>
<td width="15%">Dell (1st)</td>
<td width="6%">1949</td>
<td width="13%">Victor Kalin</td>
<td width="9%">Mystery</td>
<td width="6%" class="cost">$7</td>
</tr>
<tr>
<td>Odor of Violets</td>
<td>Baynard Kendrick </td>
<td>Dell (1st)</td>
<td>1947</td>
<td>Gerald Gregg</td>
<td>Mystery</td>
<td class="cost">$2</td>
</tr>
<tr>
<td>Top of the Heap</td>
<td>A.A.Fair (Erle Stanley Gardner)</td>
<td>Dell</td>
<td>1954</td>
<td>Griffith Foxley</td>
<td>Mystery</td>
<td class="cost">$5</td>
</tr>
<tr>
<td>Gods and Goddesses In Art and Legend</td>
<td>Herman J. Wechsler</td>
<td>Pocket Book (1st)</td>
<td>1950</td>
<td>N/A (photo)</td>
<td>Art</td>
<td class="cost">$0.50</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td>Total:</td>
<td id="sumTotal"></td>
</tr>
</table>
할 수 있습니다 은
}
그리고 HTML 소스가 사전에 아틸라을 주셔서 감사합니다html 샘플을 공유하십시오 –
위의 HTML 샘플을 추가했습니다. – reinhat