A little looking and I found this: DataTables example - Complex headers
So it’s certainly doable, although that solution has a fair bit of complexity!
Edit: Even better: position: sticky
: https://jsfiddle.net/qwubvg9m/1/. This one is fairly simple.