var td = [...document.querySelectorAll('table td')];
var td = [...document.querySelectorAll('.scrollMouse')[0].querySelectorAll('table td')];
<div class="scrollMouse"><table></table></div>
var first = td[0].offsetLeft;
var elems = document.querySelectorAll('.scrollMouse');
for (var a = 0; a < elems.length; a++) {
var td = [...elems[a].querySelectorAll('table td')];
var first = td[0].offsetLeft;
var last = Math.max(...td.map(n => n.offsetLeft + n.offsetWidth));
var firstTd = td.filter(n => n.offsetLeft === first);
var lastTd = td.filter(n => n.offsetLeft + n.offsetWidth === last);
firstTd[firstTd.length - 1].classList.add('round-left-bottom');
lastTd[lastTd.length - 1].classList.add('round-right-bottom');
lastTd.forEach(n => n.classList.add('border-right'));
}