

This is the same as having no preferred width set. If the available width changes then the table will automatically grow or shrink to reflect these changes. This fits the element to the given width in points.įits the element relative of the available space in the window or container size. The preferred width property can be expressed in one of several different ways: Width Type In some cases it may not be possible to fit to this exact width, but the real width will come close to this value on most occasions. This is the size that the element strives to fit to. That is a preferred width can be specified on individual cells or to the table as a whole. The desired width of a table or individual cells is defined through the preferred width property. It does not depend on anything and it does not change when a table or other cell properties change. Cell preferred width is a cell property that is stored in the document. For example, changing page margins or preferred table width may affect the actual cell width. The actual cell width may depend on many things. Cell width is actually a calculated value for Docx format. Cell preferred width is more aligned with DOCX format specification and with Aspose.Words model as well. Therefore in most cases, if you are building your table programmatically but are finding it hard to create the desired table you can instead try visually creating it in Microsoft Word first and then simply copy the formatting values to your application.Ī preferred cell is recommended rather than the width in most cases. These are each explained in detail in this article.Īll of the properties and techniques that are described in this article all link back to how tables work in Microsoft Word. Table elements present several different properties that can affect how the width of the overall table as well as individual cells are calculated. This is useful to know in such cases where a table layout does not appear as expected.
#Change cell margins in word full#
This article gives an in-depth look into how the different width calculation properties of tables work and provides information which will allow you gain full control of how table widths are calculated. These properties allow considerable control over the overall appearance and behavior of the table.

A table in a Microsoft word document provides several different ways to size a table and individual cells.
