In Aspose.Words a table is normally inserted using DocumentBuilder. By default, Aspose.Words always creates inline tables. A newly created table is given similar defaults as used in Microsoft Word: Table PropertyĪ table can be inline where it is tightly positioned or can be floating where it can be positioned anywhere on the page.
This article presents the full details of how to insert formatted tables using each technique as well as a comparison of each technique at the end of the article. Create a TableĪspose.Words provides several different methods to create new tables in a document. This behavior is identical in both Microsoft Word and Aspose.Words. This is used to separate consecutive tables and without it such consecutive tables would be joined together into one. It is a requirement for a Microsoft Word document to have at least one paragraph after a table. You should also notice table is succeeded with an empty paragraph. In Aspose.Words all table related classes and properties are contained in the namespace. Each of the two cells contains a paragraph which is the container of the formatted text ion a cell. You can see in the diagram above that the document contains a table which consists of one row which in turn consists of two cells. This relationship is best represented by inspecting the structure of a Table node in a document through the use of DocumentExplorer. Additionally cells can contain further nested tables. A Cell is what contains the true content seen in a table and is made up of Paragraph and other block level nodes.Additionally a Row provides members which define how a row is displayed, for example the height and alignment. A Row represents a single row of a table and contains many Cell nodes.A Table exposes all the normal members of a node which allows you to freely move, modify and remove the table in the document. Furthermore, tables can be nested inside other tables up to any depth.Ī Table node does not contain any real content - instead it is a container for other such nodes which make up the content: A table can be found as a child of the main body of text, an inline story such as a comment or footnote, or within a cell as a nested table. Rendering of tables with high fidelity is also supported.Ī table from any document loaded into Aspose.Words is imported as a Table node. You are able to freely edit, change, add and remove tables. Tables in Aspose.Words are fully supported. These are concepts which are common to all tables in general whether they come from a Microsoft Word document or an HTML document. While you would normally have plain text in a table, you can also put other content in cells, such as images or even other tables. This is a common example of a table found in a Microsoft Word document:Ī table is comprised of elements such as Cell, Row and Column. You can lay out content which is to be kept in a fixed position by using a borderless table. They are also frequently used as a page layout tool, and a better alternative for displaying tabbed data (with tab stops) as they allow much better control over the design and layout of the content. They allow for large amounts of information to be organized and displayed cleanly in a grid like structure with rows and columns. Tables are a common element found in word documents. Use the AutoFit feature in Microsoft Word.Remove a Table or Table Elements in Microsoft Word.Insert a Table Directly into the Document Object Model.Aspose.Total Product Family Aspose.Words Product Solution Aspose.PDF Product Solution Aspose.Cells Product Solution Aspose.Email Product Solution Aspose.Slides Product Solution Aspose.Imaging Product Solution Aspose.BarCode Product Solution Aspose.Diagram Product Solution Aspose.Tasks Product Solution Aspose.OCR Product Solution Aspose.Note Product Solution Aspose.CAD Product Solution Aspose.3D Product Solution Aspose.HTML Product Solution Aspose.GIS Product Solution Aspose.ZIP Product Solution Aspose.Page Product Solution Aspose.PSD Product Solution Aspose.OMR Product Solution Aspose.PUB Product Solution Aspose.SVG Product Solution Aspose.Finance Product Solution Aspose.Drawing Product Solution Aspose.Font Product Solution Aspose.TeX Product Solution