Yeah that’s basically the approach I take too, except that I prefer to code the table headers into data attributes, then you can define them in a single CSS rule without having to specify content in the stylesheet, i.e:
<td data-header="First Name">James</td>
Then:
td::before { content:attr(data-header); }