41 lines
1.0 KiB
JavaScript
41 lines
1.0 KiB
JavaScript
window.addEventListener('load', () => {
|
|
setIDtable();
|
|
})
|
|
|
|
function setIDtable() {
|
|
var liczba = 0;
|
|
|
|
console.log('działa to ten');
|
|
document.querySelectorAll('table tr ').forEach(td => {
|
|
liczba++
|
|
td.setAttribute('id', 'row'+liczba);
|
|
|
|
})
|
|
document.querySelectorAll('table tr:not(:first-child) td:nth-child(2)').forEach(td => {
|
|
|
|
td.setAttribute('class', 'photo');
|
|
|
|
})
|
|
document.querySelectorAll('table tr:not(:first-child) td:nth-child(6)').forEach(td => {
|
|
|
|
td.setAttribute('class', 'kategoria');
|
|
|
|
})
|
|
document.querySelectorAll('table tr:not(:first-child) td:nth-child(7)').forEach(td => {
|
|
|
|
td.setAttribute('class', 'kategoria1');
|
|
|
|
})
|
|
document.querySelectorAll('table tr:not(:first-child) td:nth-child(8)').forEach(td => {
|
|
|
|
td.setAttribute('class', 'powiekszenie');
|
|
|
|
})
|
|
document.querySelectorAll('table tr:not(:first-child) td:nth-child(9)').forEach(td => {
|
|
|
|
td.setAttribute('class', 'opis' );
|
|
|
|
})
|
|
|
|
|
|
} |