From looking at forum posts, I see there’s an issue with adding custom styles for tables. So rather than using direct formatting, what approach should I take for styling the alignment of text in table columns? For instance if I’m making an invoice, I want item descriptions in one column to be left-aligned, but I want prices in other columns to be right aligned.
Do I simply change the properties per cell/row/column for the default table style? Or is this classed as direct formatting? But is it ok when I do it within the properties dialog of a style? I notice when I change the properties of a column to change the alignment, a “clear direct formatting” button is available and clicking it reverts the changes I made to the alignment.
I notice I can also select “none” for style when inserting a table.
You can use different Format styles/Paragraph styles. Example:
Lieferschein mit Formatvorlagen - ausgefüllt.odt (18,7 KB)
I suggest to always use None for tables.
Table styles use macros and will overwrite any formatting or styles that you apply when you edit the table again.
And do as @Hrbrgr suggests, use paragraph styles for your columns
Ok, but just say the invoice table has some text underneath (not necessarily a footer) and I use normal paragraph style for that, presumably I can just add a new paragraph style specifically for text in tables? When I tried this, using “new style frrom selection”, table cell padding wasn’t set in the new style, so I guess that’s a property of a cell, not the style of the contents of a cell that the style was copied from?
There is already Table Contents as default paragraph style for tables. It has Table Heading as a child style.
You could modify Table Contents to suit, or you could right click it, select New and modify just those attributes that you want. You might want a new paragraph style for the last line of the table.
If you want to change the font, consider changing it in Default Paragraph style instead, it should apply that font to just about all paragraph styles except Heading (and its children) and Preformatted Text.
The cell padding is a property of the table; don’t be tempted to create your own table style, it will be infected by the same rigid macro that reapplies the original settings when you edit it.
Note
If a table style has been applied to a table the only way to remove it is to click Table > Convert > Table to text, then select the text and click Table > Convert > Text to table. Select None in the dialogue and, after OK, modify the table to suit.
.
To create a repeatable table with column widths (not part of a table style) padding, paragraph style, etc. modify a blank table to suit and then add it to AutoText with a suitable name. It can then be added by typing the shortcut and pressing F3
Great. Thanks for the help! I’ll try all those suggestions.