insert table's header before table's body

Insert table's header before table's body. 

In previous variant header was inserted as first child in table. If table has additional elements like 'col', 'colgroup', 'caption' - they will not work, because they should be 'before' thead section. This fix allows to use additional table elements without any restrictions.