Table CSS margin settings are ignored when converting from HTML to PDF

When converting from HTML to PDF with Aspose.Word for Java v24.10 table margins defined for CSS are ignored. I can reproduce this using the online converter at https://products.aspose.app/words/conversion/html-to-pdf as well.

Given the following HTML file…

<!DOCTYPE html>
<html>
	<head>
		<title>
			Table margins
		</title>
		<style>
		table { 
			margin: 10px auto;
			border: 1px solid #000000;
			width:100%;
		}
		</style>
	</head>
	<body>
		<table>
			<tbody>
				<tr>
					<td>
						A table with one cell
					</td>
				</tr>
			</tbody>
		</table>
		<table>
			<tbody>
				<tr>
					<td>
						A table with one cell
					</td>
				</tr>
			</tbody>
		</table>
		<table>
			<tbody>
				<tr>
					<td>
						A table with one cell
					</td>
				</tr>
			</tbody>
		</table>
	</body>
</html>

Here is a screenshot showing the file as displayed in Chrome and the resulting PDF when converting with Aspose.Word…

MarginCSSBug.jpg (102.4 KB)
MarginCSSBug.jpg (102 KB)

@rgabbard Please note, Aspose.Words Document Object Model is designed to work with MS Word documents. HTML documents object model is quite different and it is not always possible to provide 100% fidelity after importing or exporting HTML document. Usually Aspose.Words mimics MS Word behavior when work with HTML documents.
If you convert your document to PDF using MS Word, the output is similar to Aspose.Words output: ms.pdf (29.8 KB)