The procedure below will add one row to the first THead element in the first table of the ActiveDocument.
Sub THeadRowsAdd()
On Error GoTo errHandler1:
Dim objelement As IHTMLElement
Dim strHTML As String
Dim intNumberOfColumns As Integer
strHTML = _
vbCrLf & _
vbTab & _
vbTab & _
vbTab & _
"<tr>"
For i = 1 To 3
strHTML = _
strHTML & _
vbCrLf & _
vbTab & _
vbTab & _
vbTab & _
vbTab & _
"<th></th>"
'vbCrLf
Next i
strHTML = _
strHTML & _
vbCrLf & _
vbTab & _
vbTab & _
vbTab & _
"</tr>"
intNumberOfColumns = 3
Set objelement = ActiveDocument.all. _
tags("table").Item(0).tHead
objelement.insertAdjacentHTML _
"afterBegin", strHTML
WebDesigner.ActivePageWindow.Save True
Exit Sub
errHandler1:
MsgBox "THead was not found." & _
vbCrLf & "Please add THead first"
End Sub
HTML code before method was run:
<table>
<thead>
</thead>
</table>
HTML code after method was run:
<table>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
</table>