Bug 120026 - Table alignment to center does not recenter upon table resizing
Summary: Table alignment to center does not recenter upon table resizing
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.7.2 release
Hardware: All All
: low enhancement
Assignee: Justin L
URL:
Whiteboard: target:7.1.0
Keywords:
: 134916 (view as bug list)
Depends on:
Blocks: Writer-Tables-Alignment
  Show dependency treegraph
 
Reported: 2018-09-21 06:28 UTC by Daniel Grigoras
Modified: 2022-03-05 11:22 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot for table centered (117.66 KB, image/png)
2018-09-21 08:30 UTC, Dieudonne Dukuzumuremyi
Details
Resized table (121.18 KB, image/png)
2018-09-21 08:34 UTC, Dieudonne Dukuzumuremyi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Grigoras 2018-09-21 06:28:04 UTC
Description:
Having a table's alignment properties set to center does not cause the table to have its position recentered on the page each time the table is resized.

Steps to Reproduce:
-

Actual Results:
-

Expected Results:
-


Reproducible: Always


User Profile Reset: No



Additional Info:
-
Comment 1 Dieudonne Dukuzumuremyi 2018-09-21 08:27:37 UTC
By using LibreOffice:
Version: 5.1.6.2
Build ID: 1:5.1.6~rc2-0ubuntu1~xenial4
CPU Threads: 8; OS Version: Linux 4.8; UI Render: default; 
Locale: en-US (en_US.UTF-8); Calc: group


My Operating system information:

Linux ubuntu 4.8.0-36-generic #36~16.04.1-Ubuntu SMP Sun Feb 5 09:39:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux



I met the same difficulties.

The steps i followed:
1. insert table
2. Right click on the table and select Table Properties
3. From the left side: On Alignment, Select Center Option
4. Click Ok.

To Resize the table:
1. By using your mouse go to the ruler, click and hold your mouse then drag from left to right, or 
from right to left
Comment 2 Dieudonne Dukuzumuremyi 2018-09-21 08:30:48 UTC
Created attachment 145084 [details]
Screenshot for table centered

After centering the inserted table this is the way the table looks like before resizing.
Comment 3 Dieudonne Dukuzumuremyi 2018-09-21 08:34:43 UTC
Created attachment 145085 [details]
Resized table

After centering the table, I resized by clicking and hold on the ruler and drag from right to left and from left to right. 
This is the result i found.
Comment 4 Telesto 2018-09-21 11:37:38 UTC
Repro with
Version: 6.2.0.0.alpha0+
Build ID: 76bf3939b0583212a56c317c85aea110f8ac6fee
CPU threads: 4; OS: Mac OS X 10.12.6; UI render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2018-07-27_06:01:47
Locale: nl-NL (nl_NL.UTF-8); Calc: group threaded

and with
Version: 4.3.7.2
Build ID: 8a35821d8636a03b8bf4e15b48f59794652c68ba

Might be by design.. Adding needUXEval
Comment 5 Heiko Tietze 2018-09-27 14:26:36 UTC
To recap, you have a small table like |-|-|------ (- for white space) and want to center it to get the same white space at left and right (otherwise Center makes no sense) ---|-|-|---. That happens on (Table) > Properties > Center but the table is then not automatically recentered when columns are resized - what you suggest to change. Right?

The radio button is, however, just a command to center the full table once. And it is reset to "From left" after modifications. Besides the wrong implementation of Center it works for me. 

But lately Justin submitted some patches for tables in Draw/Impress and perhaps he has a different opinion.
Comment 6 Justin L 2018-09-29 15:22:20 UTC
(In reply to Heiko Tietze from comment #5)
> To recap, you have a small table like |-|-|------ (- for white space)
Whitespace has nothing to do with his bug report - just the fact that resizing the table resets the alignment.

> The radio button is, however, just a command to center the full table once.
No, it is more than just a one-time command to center the table. Going back to the properties (without resizing the table) shows that it is still centered, and changing the page size/orientation for example properly moves the table to the center of the new page layout.

The request to re-center the table makes theoretical sense to me - but from a UI perspective it would cause problems as the table would "jump" as soon as the user lets go of the button. (Word can do this, it re-centers the table interactively while you are enlarging it - tricky.)

Legitimate, but very unlikely to happen.
Comment 7 Heiko Tietze 2018-10-01 14:10:27 UTC
(In reply to Justin L from comment #6)
> ... 
> > The radio button is, however, just a command to center the full table once.
> No, it is more than just a one-time command to center the table.

Today it works like a command and we could keep that/make it more clear by e.g. moving "Center" into a button. Of course there is also the option to keep a table centered. Sounds weird to me - you enlarge a column and suddenly the table is replaced. As you say: jumps.

> Legitimate, but very unlikely to happen.

Vote for WF.
Comment 8 Regina Henschel 2018-10-01 15:43:53 UTC
"center" is one of the values of attribute table:align of <style:table-properties> element in ODF. Why should it not be supported? If users select this value, I assume they know the effect. It is not different from having a frame centered and resizing the frame by e.g. dragging the right edge.
Comment 9 Heiko Tietze 2018-10-04 14:57:50 UTC
We discussed the issue in the design meeting and agree with Justin and Regina that after any resize operation the table has to get recentered automatically if the option is set.

Looks pretty much like an easyhack.
Comment 10 Justin L 2020-07-18 09:04:45 UTC
proposed fix at http://gerrit.libreoffice.org/c/core/+/98991
Comment 11 Commit Notification 2020-07-18 11:00:57 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9712e25425e22b59afce82f26a14a48ebb37cd38

tdf#120026 sw: keep table centered when resizing

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 BogdanB 2020-07-20 19:18:00 UTC
This bug is fixed.
Center - change a column - also centered

Verified in
Version: 7.1.0.0.alpha0+
Build ID: abea0d6647c7f1f7e76c73c26cb80e6a67dc5111
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 13 BogdanB 2020-07-20 19:21:17 UTC
But I have a question about the same issue with right alignment. If I have a table align to the right and I move the right margin inside a litle, the table will be align "From left". It's ok to be like this?...
Comment 14 BogdanB 2020-07-20 19:53:38 UTC
*** Bug 134916 has been marked as a duplicate of this bug. ***
Comment 15 Heiko Tietze 2020-07-21 09:35:01 UTC
(In reply to BogdanB from comment #13)
> But I have a question about the same issue with right alignment. If I have a
> table align to the right and I move the right margin inside a litle, the
> table will be align "From left". It's ok to be like this?...

Sounds like another topic. Please file a ticket.