It's very likely that…

posted on

…if you're putting cursor: pointer on a <th> with a click event attached, you want to use a <button> instead.

<th style="cursor: pointer">
  Name
</th>

More accessible alternative:

<th aria-sort="ascending">
  <button>Name</button>
</th>

Explanation

Only put click events on interactive elements like <button>. <th> is not an interactive element and thus not focusable.

8