Rewrote table header generation This fixes sort index issue
Merge pull request #1 from vkanevska/master

Rewrote table header generation