atanov,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
table{border-collapse:collapse;border:solid black 1px;display:table;}
.edivedit{background-color:grey;height:100px;width:100px;}
p {
height: 1000px;
}
</style>
</head>
<body>
<p></p>
<table><tbody>
<tr><td>1</td><td>1</td><td>1</td></tr>
<tr><td>2</td><td>2</td><td>2</td></tr>
<tr><td>3</td><td>3</td><td>3</td></tr>
</tbody></table>
<script>
document.getElementsByTagName('table')[0].onclick = getS;
var scrolledY;
function getS(){
scrolledY = window.pageYOffset;
document.getElementsByTagName('table')[0].style.display = 'none';
var divforedit = document.createElement('div');
divforedit.className = 'edivedit';
divforedit.id = 'ediv';
document.body.appendChild (divforedit);
var ebutton = document.createElement('button');
//ebutton.className = 'button-' + buttonnames[i];
ebutton.id = 'ebutton';
ebutton.innerHTML = 'Exit';
divforedit.appendChild (ebutton);
document.getElementById('ebutton').onclick = exit;
}
function exit(){
document.getElementById('ediv').remove();
document.getElementsByTagName('table')[0].style.display = 'table';
window.scrollTo( 0, scrolledY);
}
</script>
</body>
</html>