If you're ok with relying on implementation detail, you can wrap the table header's default renderer something like
Only tested under MetalLookAndFeel. Use the idea at your own risk.
edit Should have mentioned clearly that the implementation detail this relies on is that a table header's default renderer (like most default cell renderers) extends JLabel.
Another approach independent of implementation detail is to use my
Default Table Header Cell Renderer class. (The class doesn't respect custom foreground/background settings on the table header, but that's a 3-line fix if you need it.)