Writer Table Number Alignment Problem

Numbers become misaligned when adding single underline to cells to be added.
I’ve tried everythng and can’t fix it and it won’t go away. As soon as the single underline is added the number in that cell moves over by a space.

Number alignment problem.odt (10.4 KB)

Looks like Bug 93975 - Toolbar table borders control causes spacing to content issues

Workaround, add right padding of 0.1 cm to all cells in column

BTW you have a strange format with the numbers having a trailing space which is a complication that hides the underlying issue a little

I don’t think “the number moves to the right”. You have inconsistent formatting in this column: the top cell has no padding, while the cells below it have 0.1cm all around. Your numbers are then badly positioned from the start.

Alignment in tabular data is better achieved with the use of a specific paragraph style defining tab stops. Tabulators have various properties. You can request a right-aligned tabulator where the right-hand side of text (in Writer tables, all data is text, even if made of numbers) will be flushed against the stop (instead of left-hand side. In case you have decimals, alignment can be made on the character separating the integral from the decimal part. This separator can be chosen at your taste, so that the feature can be used for other data than numbers.

By using such a custom paragraph style, you guarantee that all your cells will look the same, provided of course that the geometry defined by Borders tab in the table configuration is the same for all celss.

PS: don’t use extra spaces after data. It matters when you have right-alignment or justification. Width of spaces can be adjusted by Writer and you never know the size.

Here: Fedora 39 (Linux), LO 7.6.3.1, KDE Plasma desktop (It is recommended to always mention OS and LO version).

I applied the same number format to all cells in the column. Why are the last two padded and the first one is not?

Probably because your “format” is not the same. You perhaps have added a space at the end of your “format”.

I actually haven’t. I’ve checked it very closely and tried several iterations and combinations of things. I’ve formatted the cells with a tab stop. As soon as the underline goes in, the number in the cell become misaligned. Please, try it yourself. If you can find a combination of formats that solves the problem I would be most grateful. While I strongly prefer LO, I did download and try this in OO and did not experience the misalignment problem.

OK, I saw what’s happening.

When I add a (bottom) border in a cell, Writer immediately adds a 0.05cm padding in the selected cells while the others are untouched.

To fix, either reset padding to 0 in the selected cells (as a second editing step) or set the same padding value all over the table. IMHO, second option is better.

This seems to be tdf#93975 mentioned by @EarnestAl.

Clearly a flaw that needs fixing.

Setting the padding to something other than zero has worked. Thanks.