Is it possible to auto-size a table cell to fit its contents? If not, are there any plans to add that functionality? Can you suggest a decent workaround in the meantime?
Here is my scenario:
I am converting an HTML document to MS Word using the Aspose DocumentBuilder. I am not using the built-in HTML conversion capabilities because I need a more accurate conversion (full support for CSS, etc). So I use MSHTML to iterate over the HTML document and build the Aspose Document Model as I go. This approach is working great, but I don’t have a great way to translate auto-sized table cells. For example,
<table border="1" style="width: 300px">
<tr>
<td>cell 1.1 contains some longer content</td>
<td>cell 1.2</td>
<td>1</td>
<td>cell 1.4</td>
</tr>
<tr>
<td>cell 2.1</td>
<td>cell 2.2</td>
<td>2</td>
<td>cell 2.4</td>
</tr>
<tr>
<td>cell 3.1</td>
<td>cell 3.2</td>
<td>3</td>
<td>cell 3.4</td>
</tr>
</table>
I am sizing the table to 300px by evenly distributing the width across the columns. However, I would like the first column to be wider and the third column to be narrower, just like it would look when viewing in a web browser.
Thanks for the help.