Text issue in table

Hello,
can you please suggest how can fix below issue in table row. when we insert two digit value then 0 shifted below to 1 . So please suggest how can fix this issue and show two digit number together.

As I am using below HTML in code.

string html="<table width='100%' style='border-collapse: collapse;border-spacing:0px;font-size:10pt;font-family:Arial'><tr style='border-bottom:1px dotted #0070C0;' ><td valign='top' style='border-right:1px solid #0070C0; padding:2px 10px;' width='7%;'>1</td><td style='padding:2px 10px;' width='93%'><span style='margin:0 10px;'> testedCase number:  tested</span><br/><span style='margin:0 10px;'> testedDate: 9 September 2025</span><br/><span style='margin:0 10px;'> tested:  tested</span><br/><span style='margin:0 10px;'>  tested: <b>tested</b> </span><br/><span style='margin:0 10px;'>  tested: <b>tested</b> </span><br/><span style='margin:0 10px;'> tested:  Cause data</span><br/><span style='margin:0 10px;'> tested:  tested Data</span><br/></td></tr></table>";
DocumentBuilder documentBuilder = new DocumentBuilder(document);
documentBuilder.InsertHtml(html, true);

@RiteshK10

It appears you are encountering an issue with the alignment of digits in your HTML table, specifically where the ‘0’ shifts below the ‘1’ when inserting two-digit values. This misalignment may be caused by the font or styling applied to the table cells.

To resolve this, you can modify the CSS styles for the table cells. Below is a revised version of your HTML with additional styles to ensure proper alignment:

string html = "<table width='100%' style='border-collapse: collapse; border-spacing: 0px; font-size: 10pt; font-family: Arial; text-align: center;'><tr style='border-bottom: 1px dotted #0070C0;'><td valign='top' style='border-right: 1px solid #0070C0; padding: 2px 10px; width: 7%;'><span style='display: inline-block;'>1</span></td><td style='padding: 2px 10px; width: 93%;'><span style='margin: 0 10px;'> testedCase number: tested</span><br/><span style='margin: 0 10px;'> testedDate: 9 September 2025</span><br/><span style='margin: 0 10px;'> tested: tested</span><br/><span style='margin: 0 10px;'> tested: <b>tested</b> </span><br/><span style='margin: 0 10px;'> tested: <b>tested</b> </span><br/><span style='margin: 0 10px;'> tested: Cause data</span><br/><span style='margin: 0 10px;'> tested: tested Data</span><br/></td></tr></table>";
DocumentBuilder documentBuilder = new DocumentBuilder(document);
documentBuilder.InsertHtml(html, true);

In this code, I have included text-align: center; in the table style and wrapped the number in a <span> with display: inline-block; to assist with alignment. You may further adjust the styles based on your specific requirements.

If the issue continues, consider reviewing the font settings or experimenting with a different font that may better accommodate digit alignment.

@RiteshK10 Unfortunately, I cannot reproduce the problem on my side. Here is the output produce on my side using the following code:

string html = "<table width='100%' style='border-collapse: collapse;border-spacing:0px;font-size:10pt;font-family:Arial'><tr style='border-bottom:1px dotted #0070C0;' ><td valign='top' style='border-right:1px solid #0070C0; padding:2px 10px;' width='7%;'>1</td><td style='padding:2px 10px;' width='93%'><span style='margin:0 10px;'> testedCase number:  tested</span><br/><span style='margin:0 10px;'> testedDate: 9 September 2025</span><br/><span style='margin:0 10px;'> tested:  tested</span><br/><span style='margin:0 10px;'>  tested: <b>tested</b> </span><br/><span style='margin:0 10px;'>  tested: <b>tested</b> </span><br/><span style='margin:0 10px;'> tested:  Cause data</span><br/><span style='margin:0 10px;'> tested:  tested Data</span><br/></td></tr></table>";
            
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertHtml(html, true);
doc.Save(@"C:\Temp\out.docx");

out.docx (7.4 KB)