tgrosinger / advanced-tables-obsidian

Improved table navigation, formatting, and manipulation in Obsidian.md
GNU General Public License v3.0
2.15k stars 80 forks source link

Need ability to center text in a table cell and maintain consistent editing display #271

Closed JESii closed 1 year ago

JESii commented 1 year ago

Describe the bug I want to create a cell in the table and have the text centered in that cell. When I do that using the <center>...</center> tag, it works, but the editing display goes all hinky.

To Reproduce Steps to reproduce the behavior:

  1. Create a table with a three column and enter some text data
  2. In one of the rows in column 2, center the text using <center>...</center> tags
  3. Move down off that row and notice what happens to the display... the text which used to fit on line now spans multiple lines

Expected behavior I would have expected the display to remain on a single line -- when I use other tags, such as <br/> tags, the display isn't hosed.

Screenshots displays as expected when not "in" the table (cursor is on line 2

CleanShot 2023-07-07 at 11 13 50@2x

click "edit this block" and things still look good

CleanShot 2023-07-07 at 11 14 53@2x

click into the table and things still look good

CleanShot 2023-07-07 at 11 16 01@2x

but as soon as I click on a cell to do some edits... goes a bit haywire

CleanShot 2023-07-07 at 11 16 36@2x

If I'm actually on one of those 'centered' items, it looks OK, but others do not CleanShot 2023-07-07 at 11 01 45@2x

Desktop (please complete the following information):

It's workable, but very disconcerting.

tgrosinger commented 1 year ago

This appears to be working as expected. There are formatting tags (</br> for example) and empty whitespace which are being hidden when your cursor is not in the table, but displayed as soon as you click into it.

If you were to view this file in a program other than Obsidian, you could see how the whitespace makes the table appear nicely formatted when viewed as plain text.

For more details on this please see #145.