Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7428631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:49:59+00:00 2026-05-29T08:49:59+00:00

I am converting a HTML file to OpenXML format using NotesForHtmlToOpenXML (http://notesforhtml2openxml.codeplex.com) Original Table

  • 0

I am converting a HTML file to OpenXML format using NotesForHtmlToOpenXML (http://notesforhtml2openxml.codeplex.com)

Original Table image

When I convert the above table’s HTML to docx format, the output is given below.

Converted docx Table image

Given below is the HTML code of the original table.

 <table id="tbl-pg-2-13-5" class="table-main" border="1" cellspacing="1" cellpadding="1">
    <tbody>
        <tr id="pg-2-14">
            <td id="pg-2-15" class="table-td" valign="top" rowspan="2" colspan="2">
            </td>
            <td id="pg-2-16" class="table-td" valign="top" colspan="2">
                <p id="pg-2-17" class="table-textstyle2">
                    <i>Consideration of use</i>
                </p>
            </td>
        </tr>
        <tr id="pg-2-19">
            <td id="pg-2-20" class="table-td" valign="top">
                <p id="pg-2-21" class="table-textstyle2">
                    <i>Low</i>
                </p>
            </td>
            <td id="pg-2-23" class="table-td" valign="top">
                <p id="pg-2-24" class="table-textstyle2">
                    <i>High</i>
                </p>
            </td>
        </tr>
        <tr id="pg-2-26">
            <td id="pg-2-27" class="table-td" rowspan="2" valign="top">
                <p id="pg-2-28" class="table-textstyle2">
                    <i>Quest for fundamental understanding</i>
                </p>
            </td>
            <td id="pg-2-30" class="table-td" valign="top">
                <p id="pg-2-31" class="table-textstyle2">
                    <i>High</i>
                </p>
            </td>
            <td id="pg-2-33" class="table-td" valign="top">
                <p id="pg-2-61" class="table-textstyle0">
                    1. Pure basic research &#x0028;Bohr&#x0029;
                </p>
            </td>
            <td id="pg-2-38" class="table-td" valign="top">
                <p id="pg-2-62" class="table-textstyle0">
                    2. Use-inspired basic research &#x0028;Pasteur&#x0029;
                </p>
            </td>
        </tr>
        <tr id="pg-2-45">
            <td id="pg-2-46" class="table-td" valign="top">
                <p id="pg-2-47" class="table-textstyle2">
                    <i>Low</i>&#x00A0;
                </p>
            </td>
            <td id="pg-2-49" class="table-td" valign="top">
                <p id="pg-2-63" class="table-textstyle0">
                    3.
                </p>
            </td>
            <td id="pg-2-52" class="table-td" valign="top">
                <p id="pg-2-64" class="table-textstyle0">
                    4. Pure applied research &#x0028;Edison&#x0029;
                </p>
            </td>
        </tr>
    </tbody>
</table>

Please provide solution to convert the above HTML to OpenXML correctly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T08:50:00+00:00Added an answer on May 29, 2026 at 8:50 am

    I was able to import using code(AltChunk & AlternateFormatImportPart) displayed below. Here finalDocument is of type WordprocessingDocument.

                       string mainhtml = "<table id=\"tbl-pg-2-13-5\" class=\"table-main\" border=\"1\" cellspacing=\"1\" cellpadding=\"1\">" +
    "<tbody>" +
        "<tr id=\"pg-2-14\">" +
            "<td id=\"pg-2-15\" class=\"table-td\" valign=\"top\" rowspan=\"2\" colspan=\"2\">" +
            "</td>" +
            "<td id=\"pg-2-16\" class=\"table-td\" valign=\"top\" colspan=\"2\">" +
                "<p id=\"pg-2-17\" class=\"table-textstyle2\">" +
                    "<i>Consideration of use</i>" +
                "</p>" +
            "</td>" +
        "</tr>" +
        "<tr id=\"pg-2-19\">" +
            "<td id=\"pg-2-20\" class=\"table-td\" valign=\"top\">" +
                "<p id=\"pg-2-21\" class=\"table-textstyle2\">" +
                    "<i>Low</i>" +
                "</p>" +
            "</td>" +
            "<td id=\"pg-2-23\" class=\"table-td\" valign=\"top\">" +
                "<p id=\"pg-2-24\" class=\"table-textstyle2\">" +
                    "<i>High</i>" +
                "</p>" +
            "</td>" +
        "</tr>" +
        "<tr id=\"pg-2-26\">" +
            "<td id=\"pg-2-27\" class=\"table-td\" rowspan=\"2\" valign=\"top\">" +
                "<p id=\"pg-2-28\" class=\"table-textstyle2\">" +
                    "<i>Quest for fundamental understanding</i>" +
                "</p>" +
            "</td>" +
            "<td id=\"pg-2-30\" class=\"table-td\" valign=\"top\">" +
                "<p id=\"pg-2-31\" class=\"table-textstyle2\">" +
                    "<i>High</i>" +
                "</p>" +
            "</td>" +
            "<td id=\"pg-2-33\" class=\"table-td\" valign=\"top\">" +
                "<p id=\"pg-2-61\" class=\"table-textstyle0\">" +
                    "1. Pure basic research &#x0028;Bohr&#x0029;" +
                "</p>" +
            "</td>" +
            "<td id=\"pg-2-38\" class=\"table-td\" valign=\"top\">" +
                "<p id=\"pg-2-62\" class=\"table-textstyle0\">" +
                    "2. Use-inspired basic research &#x0028;Pasteur&#x0029;" +
                "</p>" +
            "</td>" +
        "</tr>" +
        "<tr id=\"pg-2-45\">" +
            "<td id=\"pg-2-46\" class=\"table-td\" valign=\"top\">" +
                "<p id=\"pg-2-47\" class=\"table-textstyle2\">" +
                    "<i>Low</i>&#x00A0;" +
                "</p>" +
            "</td>" +
            "<td id=\"pg-2-49\" class=\"table-td\" valign=\"top\">" +
                "<p id=\"pg-2-63\" class=\"table-textstyle0\">" +
                    "3." +
                "</p>" +
            "</td>" +
            "<td id=\"pg-2-52\" class=\"table-td\" valign=\"top\">" +
                "<p id=\"pg-2-64\" class=\"table-textstyle0\">" +
                    "4. Pure applied research &#x0028;Edison&#x0029;" +
                "</p>" +
            "</td>" +
        "</tr>" +
    "</tbody>" +
    

    “”;

                    AlternativeFormatImportPart chunk = finalDocument.MainDocumentPart.AddAlternativeFormatImportPart(AlternativeFormatImportPartType.Html);
    
                    using (Stream chunkStream = chunk.GetStream(FileMode.Create, FileAccess.Write))
                    {
                        using (StreamWriter stringWriter = new StreamWriter(chunkStream, Encoding.UTF8))
                        {
                            stringWriter.Write(mainhtml);
                        }
                    }
    
                    AltChunk altChunk1 = new AltChunk();
                    altChunk1.Id = finalDocument.MainDocumentPart.GetIdOfPart(chunk);
    
                    finalDocument.MainDocumentPart.Document.AppendChild(altChunk1);
    
    
                    finalDocument.MainDocumentPart.Document.Save();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am parsing data from a json file and converting to a HTML table,
I am using xslt to converting html to a text file. When I view
I have written an xsl for converting the trx file of mstest into html.
I tried converting word newsletter to html by File->Save as->Other formats and then choose
Possible Duplicates: Converting HTML Files to PDF PDF file generation from XML or HTML
I'm trying to generate an excel file using html in php and responding with
I have a HTML table (HTML with table is a static file on server).
Our system dynamically generates a large report by converting many HTML pages into a
I am converting an old html based website to ASP.NET, so that we can
I was wondering if converting POST input from an HTML form into html entities,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.