How to Insert Content Control on a Table in Word Doc

I am using Aspose.Words for .NET
I am Inserting a Content Control using StandartDocumentTag class and inserting table html using documentBuilder -

<table border="1" cellpadding="5" cellspacing="0">
    <tr>
        <th>Header 1</th>
        <th>Header 2</th>
        <th>Header 3</th>
    </tr>
    <tr>
        <td>Row 1, Cell 1</td>
        <td>Row 1, Cell 2</td>
        <td>Row 1, Cell 3</td>
    </tr>
    <tr>
        <td>Row 2, Cell 1</td>
        <td>Row 2, Cell 2</td>
        <td>Row 2, Cell 3</td>
    </tr>
    <tr>
        <td>Row 3, Cell 1</td>
        <td>Row 3, Cell 2</td>
        <td>Row 3, Cell 3</td>
    </tr>
</table>

Expected Output :

My Output:

The scoping is not coming properly,
In first picture you can see the original scoping of word functionality, that starts scoping from first cell of first row and goes on to last cell of last row.

But, in below image, The scoping goes outside of the table.
How to solve this issue My code is below.

//move to end 
docBuilder.MoveToDocumentEnd();

//insert content control
StructuredDocumentTag sdt = new StructuredDocumentTag(doc, SdtType.RichText, MarkupLevel.Block);

//append the content control
doc.LastSection.Body.AppendChild(sdt);

//move inside the content control
docBuilder.MoveTo(sdt.FirstChild);

//inserting html to the content control
docBuilder.InsertHtml(myTableHtml.ToString().Trim());

//moving out of the content control
Node newPara = doc.LastSection.Body.AppendChild(new Paragraph(doc));
docBuilder.MoveTo(newPara);

@Kunal8460 You can modify the code like the following to get the expected output:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

//insert content control
StructuredDocumentTag sdt = new StructuredDocumentTag(doc, SdtType.RichText, MarkupLevel.Block);
sdt.RemoveAllChildren();
sdt.AppendChild(new Paragraph(doc));

//append the content control
doc.LastSection.Body.AppendChild(sdt);

//move inside the content control
builder.MoveToStructuredDocumentTag(sdt, 0);

//inserting html to the content control
builder.InsertHtml(File.ReadAllText(@"C:\Temp\in.html"));

// Remove an empty paragraph inserted after the table.
builder.CurrentParagraph.Remove();

doc.Save(@"C:\Temp\out.docx");

out.docx (11.2 KB)

There is no MoveToStructuredDocumentTag() method available in sdt class

@Kunal8460 Most likely you are using an old version of Aspose.Words:
https://reference.aspose.com/words/net/aspose.words/documentbuilder/movetostructureddocumenttag/