tp-20,
формируйте таблицу по "человечески" и будет вам счастье.
<style>
table {border-collapse: collapse;}
td, th {
border: 1px solid rgba(128, 128, 128, 0.25);
padding: 0.5em;
}
table > thead > tr:first-child {background-color: #999;}
table tbody:nth-child(odd):hover {box-shadow: 0 0 0 2px red inset;}
table tbody:nth-child(even):hover {box-shadow: 0 0 0 2px blue inset;}
</style>
<table>
<thead>
<tr>
<th>Имя</th>
<th>Предмет</th>
<th>Кол-во</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="4">Маша</td>
<td>Карандаш</td>
<td>1</td>
</tr>
<tr>
<td>Ручка</td>
<td>3</td>
</tr>
<tr>
<td>Блокнот</td>
<td>4</td>
</tr>
<tr>
<td>Прищепка</td>
<td>4</td>
</tr>
</tbody>
<tbody>
<tr>
<td rowspan="3">Саша</td>
<td>Шишка</td>
<td>5</td>
</tr>
<tr>
<td>Мышка</td>
<td>1</td>
</tr>
<tr>
<td>Батарейка</td>
<td>6</td>
</tr>
</tbody>
</table>