Generate <tbody> and <thead> element in tables