Aspose table alignment is not working properly in case of chinese langague

We are creating aspose report using html tags, the formatting in english language comes differently as compared to chinese. Even if the colspan is declared the table adjust its column as per content.

image.png (31.2 KB)

@mayurih

It seems you’re experiencing issues with table alignment in Aspose when generating reports using HTML tags, particularly with Chinese language content. This can occur due to differences in how text is rendered based on language and content length, which may affect the colspan and overall table structure.

To address this, ensure that your HTML and CSS are properly configured for handling different languages. Here are a few suggestions:

  1. CSS for Table Layout: Use CSS properties like table-layout: fixed; to maintain consistent column widths regardless of content. This can help mitigate alignment issues.

  2. Explicit Widths: Set explicit widths for your table columns to prevent them from adjusting based on content. For example:

    <table style="table-layout: fixed; width: 100%;">
        <colgroup>
            <col style="width: 50%;">
            <col style="width: 50%;">
        </colgroup>
        <tr>
            <td colspan="2">Your content here</td>
        </tr>
    </table>
    
  3. Testing with Different Encodings: Ensure that the encoding used for your HTML content supports Chinese characters properly. UTF-8 is generally recommended.

If these suggestions do not resolve the issue, consider reviewing the Aspose documentation for any specific settings related to table rendering or language support.

Feel free to reach out if you need further assistance!

I have applied above changes but not working… Below is my html

<style>p{padding:0px;margin:0px;}</style>
<table class='FindingDetailTable' cellspacing='5' style='width:100%;'>
	<tr>
		<td colspan='4' style='padding-bottom:20px;text-align:left;font-size:22pt;color:#ffc700;width:100%;font-weight: bold;font-family:Calibri; '>$Z7_FindingDetail$</td>
	</tr>
	<tr style='font-size:10pt;color:black;'font-family:Calibri;  valign='top'>
		<td width='20%' style='border-top:0.25px black solid;border-bottom:0px;'>
			<span style='font-size:10pt;color:black;'>
				<b>审核发现编号:</b>
			</span>
		</td>
		<td width='30%' style='border-top:0.25px black solid;border-bottom:0px;'>
			<span style='font-size:10pt;color:black;'>
				<b>审核准则:</b>
			</span>
		</td>
		<td width='25%' style='border-top:0.25px black solid;border-bottom:0px;padding-right:60px'>
			<span style='font-size:10pt;color:black;'>
				<b>纠正措施计划日期:</b>
			</span>
		</td>
		<td width='25%' style='border-top:0.25px black solid;border-bottom:0px;'>
			<span style='font-size:10pt;color:black;'>
				<b>纠正措施执行日期:</b>
			</span>
		</td>
	</tr>
	<tr style='font-size:10pt;color:black;'font-family:Calibri;  valign='top'>
		<td width='20%' >
			<span style='font-size:10pt;color:black;'>Finding - 1</span>
		</td>
		<td width='30%'>
			<span style='font-size:10pt;color:black;'>ISO 9001:2015
				<br/>ISO 14001:2015
			</span>
		</td>
		<td width='25%'>
			<span style='font-size:10pt;color:black;'>2025年11月13日</span>
		</td>
		<td width='25%'>
			<span style='font-size:10pt;color:black;'>2025年12月13日</span>
		</td>
	</tr>
	<tr style='font-size:10pt;color:black;'font-family:Calibri;  valign='top'>
		<td style='border-top:0.25px black solid;border-bottom:0px;'>
			<span style='font-size:10pt;color:black;'font-family:Calibri; >
				<b>签发人:</b>
			</span>
		</td>
		<td style='border-top:0.25px black solid;border-bottom:0px;'>
			<span style='font-size:10pt;color:black;'font-family:Calibri; >
				<b>类别:</b>
			</span>
		</td>
		<td style='border-top:0.25px black solid;border-bottom:0px;'>
			<span style='font-size:10pt;color:black;'font-family:Calibri; >
				<b>文件编号:</b>
			</span>
		</td>
		<td style='border-top:0.25px black solid;border-bottom:0px;'>
			<span style='font-size:10pt;color:black;'font-family:Calibri; >
				<b>回复要求:</b>
			</span>
		</td>
	</tr>
	<tr style='font-size:10pt;color:black;'font-family:Calibri;  valign='top'>
		<td style='border-bottom:0.25px black solid;border-top:0px;'>
			<span style='font-size:10pt;color:black;'font-family:Calibri; ></span>
		</td>
		<td style='border-bottom:0.25px black solid;border-top:0px;'>
			<span style='font-size:10pt;color:black;'font-family:Calibri; >
				<table style='width:100%;font-size:10pt;'>
					<tr>
						<td valign=bottom style='width:13px;'>
							<img src='D:\Users\admin.root.harkulkar\Source\Repos\intertek-it\SMART\WebApp\01-Presentation\Intertek.Smart.Web\/bin/Aspose_Major.png' style='width:15px;height:15px;' />
						</td>
						<td style='text-align:left;'>&nbsp;重大不符合</td>
					</tr>
				</table>
			</span>
		</td>
		<td style='border-bottom:0.25px black solid;border-top:0px;'>
			<span style='font-size:10pt;color:black;'font-family:Calibri; ></span>
		</td>
		<td style='border-bottom:0.25px black solid;border-top:0px;'>
			<span style='font-size:10pt;color:black;'font-family:Calibri; >提交纠正措施计划</span>
		</td>
	</tr>
	<tr style='font-size:10pt;color:black;'font-family:Calibri; >
		<td colspan='4' >
			<div style='margin-top:10px;'>
				<div style='font-weight:bold;'>
					<span style='font-size:10pt;font-family:Calibri (Body);color:black;font-weight: bold;'>审核发现:</span>
				</div>
				<div>
					<span style='font-size:10pt;font-family:Calibri (Body);color:black;'>
						<p>&nbsp;</p>
					</span>
				</div>
			</div>
			<div style='margin-top:10px;'>
				<span style='font-size:10pt;font-family:Calibri (Body);color:black;font-weight: bold;'>要求:</span>
				<span style='font-size:10pt;font-family:Calibri (Body);color:black;'>
					<table  style='table-layout: fixed;border-collapse:collapse;width:100%;font-size:10pt; color: black;font-family: Calibri (Body);'>
						<tr>
							<td style='width:30%'>5.3a</td>
							<td style='vertical-align: top;width:70%;'>ISO 9001:2015</td>
						</tr>
						<tr>
							<td colspan ='2' >
								<P>
									<Font Style="FONT-FAMILY: 微软雅黑;FONT-SIZE: 10pt;COLOR: #000000;">最高管理者应分配职责和权限,以确保质量管理体系符合本标准的要求。</Font>
								</P>
							</td>
						</tr>
						<tr>
							<td colspan ='2'>
								<br/>
							</td>
						</tr>
					</table>
				</span>
			</div>
			<div style='margin-top:10px;'>
				<div style='font-weight:bold;'>
					<span style='font-size:10pt;font-family:Calibri (Body);color:black;font-weight: bold;'>客观证据:</span>
				</div>
				<div>
					<span style='font-size:10pt;font-family:Calibri (Body);color:black;'>
						<p>&nbsp;</p>
					</span>
				</div>
			</div>
		</td>
	</tr>
</table>

english one is properly aligned.

image.png (32.2 KB)

@mayurih

Can you please share your sample code snippet with us as well that you have been using for the conversion? We will test the scenario in our environment and address it accordingly.