It depends on how you define efficiency. Is it less code for you to write? Sure.
Will it be faster or slower to execute in the browser than regular CSS? Typically slower. How much so depends on the client browser as well as the structure and size of the table.
A large table will obviously take longer for the javascript to execute on. Large in this case might be hundreds (or thousands) of rows depending on the browser. Longer might mean 500ms or so. Newer browsers have faster javascript runtimes so it might not even be noticeable.
However, if your table is structured correctly (e.g. you are using table-layout:fixed) and have exactly defined widths (e.g. you are not using percentages or anything else that requires a calculation) then the fastest possible method of rendering would be to just set the class attribute in the html.
thfor a table header?