Working With Tables in Writer
- 1 Creating and Customizing Tables
- 2 Formatting a table
- 3 Number Recognition and Data Operations
Creating and Customizing Tables
|At the beginning of a document or a section in order to introduce content before the table it is necessary to go to the first cell (top left) and press|
There are two ways to insert a table in a Writer document:
Using the Table icon
To insert a table quickly from the standard tool bar:
- Place the cursor where you want the table to appear.
- Click the arrow to the right side of the Table icon.
- In the drop down grid, select the number of rows and columns for the table.
- The table will appear at the location of your cursor.
Using the Insert Table dialog box
To insert a table with more control over the settings and properties, use the Insert Table dialog box.To open the dialog box, select Table → Insert → Table or + or left click the Table icon. From this dialog box you can:
- Select the number of rows and columns of the table
- Give a name to the table to later distinguish it in the Navigator
- Select the Heading option to define the first row in the table as the heading
- Select the Repeat heading option to repeat the heading row if the table spans more than one page
- Select the Don't split table option to prevent the table from spanning more than one page
- Select the Border option to surround each cell of the table with a border
Thebutton at the bottom of the dialog box opens the AutoFormat dialog box:
From here it is possible to choose between different predefined formats.
If none of the predefined autoformats have the desired characteristics for your table, you can tune the format of the table or of a particular cell with the contextual Table toolbar. Open the toolbar by placing the cursor inside a table cell or select View → Toolbars → Table. If you wish to save the formatting you just created, place your cursor inside the table, and select Table → AutoFormat and then press . Provide a name for the new AutoFormat so you can find it later.
Creating nested tables
You can create tables within tables. To achieve this, click in a cell of an existing table, and follow any method as described above to insert another table.
Captioning a table
It is possible to assign a caption (with numbering) to a table. Simply place the cursor inside the table, right click, and choose Caption.
As shown in the screenshot you can choose the numbering, the separator between number and text, and the position of the caption. The drop down menu "Category" can be edited. For example, if you want "Data" instead of "Table", you can click over the white box where the word "Table" is, and edit the text in the box to create another category.
By choosing thebutton you can set that all the inserted tables are automatically associated to a caption, while the button gives you the chance to define if the table number needs to reflect the chapter number.
Formatting a table
Formatting a table involves the formatting of the table layout, and the formatting of the table text. Formatting the layout involves adjusting the size of the table, its position on the page, adding or removing rows or columns, merging and splitting cells, changing borders and the background.
Inserting rows and columns
To insert rows or columns inside a table:
- Place the cursor in the row or column where you will add new rows or columns and right click.
- Choose Row → Insert or Column → Insert. A dialog box will appear, from which you can select the number of rows or columns to insert. You can also set the position of the new rows or columns to Before or After.
- Click OK to close the dialog box.
Merging and splitting cells
To merge a group of cells:
- Select the cells to merge.
- Right click and choose Cell → Merge or choose Table → Merge Cells from the menu bar.
To split a cell:
- Place the cursor inside the cell.
- Right click and choose Cell → Split, or choose Table → Split Cells from the menu bar.
- Select the direction of the split, horizontally (more rows), or vertically (more columns), as well as the total number of cells to create.
Within the Table Format dialog box (from the menu bar select Table → Table Properties), you can set the borders for a table or a group of cells and adjust the properties of the borders.
The properties of a border are as follows:
- Line arrangement specifies where the borders go. Writer provides five default arrangements, but you can modify the defaults or create your arrangement by clicking on the line you want to customize in the User-defined area. Clicking on a line area once creates a border and clicking twice creates a bold weight border. Clicking on an intersection modifies multiple borders simultaneously.
- Line specifies what the border will look like in style and color. You can select from a number of different styles and colors. The style and color will be shown on the User-defined area under Line arrangement if any borders are selected.
- Spacing to contents specifies how much space to leave between the border and cell contents. Choose Synchronize to have the same spacing for all four sides. The spacing functions like padding and is factored when calculating text measurements.
- Shadow style applies to the whole table. You can choose from five default positions, how far from the table the shadow is cast, and the color of the shadow.
|Note: If Merge adjacent line styles is selected, two cells sharing a common border will have their borders merged, rather than be side by side.|
Resizing and positioning the table
A newly created table will occupy the entire width of the text area by default. This may be what you want, but you can resize the table in a few easy steps.
To resize quickly, use the mouse to hover over the table edge until the cursor becomes a double arrow, and drag the border to its new desired position. To resize a row height, place the cursor inside the cell and drag the border to the desired height. This method can change the size of the columns and rows, but not the alignment of the table.
For more precise sizing and positioning, open the Table Format dialog box by choosing Table → Table Properties or right clicking inside the table and choosing Table.
For column resizing, choose the Columns tab. Use the column width fields to adjust the individual columns. The remaining space field shows how much further the table can expand before hitting the limits of the margins. This value cannot be edited and will not be negative.
Choosing from the following will change how the columns are sized:
- Adapt table width: increasing the width of a column will increase the width of the whole table. If the table already stretches to the page margins, it cannot stretch any wider and this option is not available.
- Adjust columns proportionally: all columns change their width by the same percentage when one is changed.
Select the Table tab inside the dialog box for alignment options. From here you can set the alignment of the table with the following:
- Automatic: the default setting, the table occupies the width of the text area
- Left: aligns with the left margin
- Right: aligns with the right margin
- From Left: you can specify under Spacing how far from the left margin to place the table
- Center: aligns in the middle between the left and right margins, though if the table width is greater than the margin, the table will extend outside of the margins. Spacing-Right and Spacing-Left have identical values.
- Manual: you can specify the distances from the left and right margins under Spacing
Any alignment option (other than Automatic) activates the Width field in the Properties section, and you can enter the desired size of the table. The relative option shows the width as a percentage of the text area.
In the Spacing section, the Above and Below boxes modify the separation between text and table. The Left and Right boxes modify the separation between the margins on the left and right of the table. You can only change both values if you select Manual alignment, you can change the Left value if you select From Left alignment.
Changing the background
You may want to change the background of a table to highlight a row or bring visual appeal to your document. You can choose to add a color or graphic to individual cells of the table, rows or the entire table. Additionally, you can vary the background within the table, highlighting only one row or using graphics and color within the same table.
To change the background of a table:
- Place the cursor inside the table.
- Right click and choose Table or from the menu choose Table → Table Properties.
- Select the Background tab inside the Table Format dialog box.
- Inside the For section, choose to apply the background to the cell, row or table.
- Cell: The background will only apply to the cell selected. If you selected a group of cells, the background will be applied individually to each cell.
- Row: the background will apply to the entire row where the cursor was placed, or the entire row of any selected cells.
- Table: The background will apply to the entire tale, regardless of which cells were selected.
- Inside the As section, choose to apply a color or a graphic.
- To apply color, select the color from the color table and click OK. To add a custom color, leave the Table Format dialog box, navigate to Tools → Options → Color, add a new color and return to the Table Format dialog box to apply.
- To apply a graphic:
- Select the file from the button. Alternatively you can use Link to link a file, changes to the graphic will be reflected in the document. You need to keep the linked graphic with the document file, or the graphic will not be shown.
- Under Type, select the type of placement of the graphic.
- Position: Select inside the position map where the graphic will be displayed
- Area: The graphic is stretched to fill the area
- Tile: The graphic is tiled to fill the area
- Choose OK to apply the changes.
Number Recognition and Data Operations
By default, Writer tries to guess which kind of data you insert on a table and format the content accordingly. For example, if you insert "10/2" Writer will interpret it as a date and change it into "10/02/13" (the result may depend on your settings under Tools → Options → Language Settings → Languages → Locale setting). To disable this, go to Tools → Options → OpenOffice Writer → Table and under "Input in tables" disable "Number recognition".
With tables on Writer it is possible to operate with data introduced on cells, for example obtaining the sum over a column.
|The operation you can do on a table on Writer are limited. If you need to perform complex calculations you need to use Calc instead. Remember that you can insert a Calc sheet on a Writer document as OLE object|
TODO: talking about the Formula toolbar ( ) and how to use it