下面的代碼不完全是,但應該足以讓你開始。我已經提取了表格最後一個tr的值,可以從那裏注意。代碼正確記錄讓我知道是否有任何問題。希望這有助於:)
<script>
$(document).ready(function() {
//Just some array to have the values available. You don't necessarily have to do this. This will just make the values available even after the loop ends.
var arr = new Array(3);
var i= 0;
//Add your table id here.
$('#yourtableid tr:last').each(function() {
$(this).find('td').each (function() {
//Iterating over each td in tr and then assigning value to each of the array element
arr[i] = $(this).html();
i++;
});
});
//Values as retrieved from the td
for(i = 0;i<3;i++){
console.log("Values in td: " +arr[i]);
}
});
</script>
去一步一步。互聯網有所有的答案。找到一種方法來循環最後一行的所有「td」。找到獲得最大價值的方法。找到一種方式來設計一個html元素。如果你分解它,這很容易! –