i need to copy the corresponding from table header entry to their table cell attr data-label in pure css. i dont need jquery.
i tried below in jquery. but i need in css example. Please give some example in pure html and css.
var $th = $("thead th");
var $tr = $("tbody tr");
$tr.each(function(){
$(this).find('td').each(function(index){
$(this).attr('data-label', $th.eq(index).text());
});
});
New contributor
karthick balakrishnan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1