The expression to count the number of THead elements in the first table of the ActiveDocument is:
THeadCount = ActiveDocument.all.tags("table"). _
Item(0).Children.tags("thead").Length
There should be only one THead element in your table.
The expression to count the number of TFoot elements in the first table of the ActiveDocument is:
TFootCount = ActiveDocument.all.tags("table"). _
Item(0).Children.tags("tfoot").Length
There should also be only one TFoot element in your table.
The w3.org says that "Tfoot must appear before TBODY within a TABLE definition so that user agents can render the foot before receiving all of the (potentially numerous) rows of data."
The expression to count the number of TBody elements in the first table of the ActiveDocument is:
TBodyCount = ActiveDocument.all.tags("table"). _
Item(0).Children.tags("tbody").Length
The w3.org also says that "The TBODY start tag is always required except when the table contains only one table body and no table head or foot sections."
The table may contain numerous TBody elements in a table.