[英]Assign the value of table header to corresponding columns using jquery
這是您的解決方案:
$(document).ready(function(){
$('tr').find('td').each(function(i){
var ind = $(this).index();
var text = $(this).text();
var header_text = $('thead > tr').find('th:eq('+ind+')').text();
$(this).text(header_text+': '+text);
});
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.