Если вы хотите предотвратить выбор текста, используйте свойство CSS user-select: none
.
.noselect{
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none;
}
th{
border: 1px solid gray;
}
<table>
<tr>
<th class="noselect">You can't select this</th>
<th>You can select this</th>
</tr>
</table>