Как то так попробуйте
<body>
<table id='div'>
<tr>
<th scope="col">Nazwę</th>
<th scope="col" >Opis</th>
<th scope="col"> </th>
</tr>
<tr>
<td>1234</td>
<td>1234</td>
<td>1234</td>
</tr>
<tr>
<td>1234</td>
<td>1234</td>
<td>1234</td>
</tr>
<tr>
<td>1234</td>
<td>1234</td>
<td>1234</td>
</tr>
</table>
<script>
let div = document.getElementById('div');
div.addEventListener('click', changeValue);
div.addEventListener('focusout', changeEnd);
function changeValue(event){
event.target.setAttribute('contenteditable', true);
}
function changeEnd(event){
event.target.removeAttribute('contenteditable');
console.log(event.target.innerText)
setValues ()
}
function setValues () {
const tbd = document.getElementById('div').tBodies[0];
const rws = tbd.rows;
const v = [];
for (let i=0; i<rws.length; i++) {
const cls= rws[i].cells;
const cv = []
for (let j=0; j<cls.length; j++) {
cv.push(cls[j].textContent);
}
v.push(cv);
}
localStorage.setItem('tblvalues',JSON.stringify(v));
console.log(localStorage.getItem('tblvalues'))
}
function restoreValues () {
const tbd = document.getElementById('div').tBodies[0];
const rws = tbd.rows;
let tbv = localStorage.getItem('tblvalues')
if (!tbv) return
const v = JSON.parse(tbv);
for (let i=0; i<rws.length; i++) {
const cls= rws[i].cells;
for (let j=0; j<cls.length; j++) {
cls[j].textContent = v[i][j];
}
}
}
restoreValues ()
</script>
</body>