When creating a new table style from selection, the table alignment property is not stored in styles.xml. When applying the style to a table, the table alignment proerty is not applied.
Steps to Reproduce:
1.Create a table and set its alignment to Centered
2.Create a new table style based on that table
3.Create another table and try to apply that style to it
The table is left-aligned
The table should be centered
User Profile Reset: No
Build ID: 9b0d9b32d5dcda91d2f1a96dc04c645c450872bf
CPU threads: 4; OS: Mac OS X 10.9.5; UI render: default;
Locale: en-US (en.UTF-8); Calc: group
I could apply the style in
Version: 18.104.22.168.beta2 (x64)
Build ID: 0f4d2060bc90b4008fbc8e6d9a49ec7eeea60b78
CPU threads: 4; OS: Windows 10.0; UI render: GL;
Locale: en-US (de_DE); Calc: CL
and also in
Version: 22.214.171.124 (x64)
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard;
Gebietsschema: de-DE (de_DE); Calc: group
I also can apply the style, but the style does not include table alignment so it does not apply Center alignment to the table. Attaching a sample document, where I created the upper table, centered it by going to Table Properties - Table - Alignment - Center, then I created the "centertable" table style from it (selected the table and clicked "New Style from Selection" on the Table Styles tab of the Styles and Formatting sidebar), added the bottom table and tried to apply the "centertable" table style to it.
Created attachment 142977 [details]
A demo document
These are my steps:
1. Table => Insert Table => Insert
2. Mark all cells
3. Align center
4. Sidebar => Styles => Table Styles => New Style => Style Name "center" => OK.
5. Table => Insert Table => Choose a style => Insert
6. Cursor in table => Choose style "center" from table style list => table is aligned to center
Perhaps you should try to reset your user profile.
I think that by step "3. Align center" you are setting center alignment for _paragraphs_ inside table cells (Format - Align - Centered), but what I meant by setting center alignment for table is "Table - Table Properties - Table - Alignment - Center".
Now it's clear to me. I can confirm the observed behaviour. I think this is more an enhancement than a bug. I'm also not sure, if it is possible to add table alingment to table styles. So I don't want to change status to NEW. Perhaps some more experienced user knows more about it.
Currently the "table styles" in the Styles&Formatting dialog are not styles in a technical sense, but they are table-templates. Such table-template is a set of cell formatting information, each of them for a special group of cells, e.g. the first row. Such cell formatting information contains a reference to a table cell style and a reference to a paragraph style. But the table template cannot have a reference to a table style. And the alignment information belongs to the element <style:table-properties>, not to the element <table:table-template>.
LibreOffice has only a rudimentary implementation of table-styles. It always writes the information as automatic-style, that is the way to write hard formatting. And if a file uses "true" table styles, LibreOffice does not understand it. The file format allows table styles as "true" styles, including inheritance and the possibility to use the same style for different tables. But LibreOffice has not implemented to use it.
The UI will be tricky, because tables refer to two sources for their formatting, an element <style:style> of family "table" and an element <table:table-template>.
So it is a valid request, to implement the use of true table styles.
There exist bug 34391 about "table styles". But in fact the entire comments in it are about table templates. Therefore I think, it is better to keep this bug report for "true" table styles. A "true" table style is an element <style:style> of family table as child element of element <office:styles>, in contrast to the current implementation as child of element <office:automatic-styles>.
(In reply to Regina Henschel from comment #7)
> So it is a valid request, to implement the use of true table styles.
I would close this ticket as WF and create another. Don't think we will have "real" table styles at any time.
(In reply to Heiko Tietze from comment #8)
> I would close this ticket as WF and create another. Don't think we will have "real" table styles at any time.
A missing feature cannot be "worksforme" and why another report? This is a feature request about table styles. "at any time" might be true, as someone has to pay for it. But keep in mind, that we currently have three different ways to format a table, and that table styles are an ODF feature, which is not implemented, and LO would fail on foreign documents, which use it. Therefore I think a refactoring is needed, and it is worth to keep this ticket.