White/transparent lines and boxes bug

When attempting to generate a Word document from a simple HTML table, depending on the zoom level in Word, white (technically transparent) lines appear in random cells. If I also include a table within the table, it also produces a white box next to the inner table. I can’t find any format options that affect this via Aspose or in Word. I’m using Aspose 18.10 and Word 2016 and for me the issue is apparent at 310% zoom, but can be seen at other random values.

<html>
	<body>
		<table style="background-color:#ff00ff;">
			<thead>
				<col style="width=100px"/>
				<col style="width=100px"/>
			</thead>
			<tbody>
				<tr>
					<td>
						<table style="font-size:20px;">
							<tbody>
								<tr>
									<td>gh</td>
								</tr>
							</tbody>
						</table>
					</td>
					<td>asfdghj</td>
				</tr>
				<tr>
					<td>asfdghj</td>
					<td>asfdghj</td>
				</tr>
			</tbody>
		</table>
	</body>
<html>

DocumentBuilder builder = new DocumentBuilder();
FileInfo f = new FileInfo(@“C:\temp\test.html”);
string r = File.ReadAllText(f.FullName);
builder.InsertHtml®;
builder.Document.Save(@“C:\temp\test.docx”);

image.png (2.5 KB)

Any ideas appreciated.

@WillR27

Thanks for your inquiry. Please note that Aspose.Words mimics the behavior of MS Word. If you convert your HTML to DOCX using MS Word, you will get the same output.

1 Like

Thanks, you’re right, reproduced the lines with that method, and the box using an online converter. Weird behaviour nonetheless.