Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Cannot align tables #6909

Open
ivailop7 opened this issue Dec 4, 2024 · 4 comments
Open

Bug: Cannot align tables #6909

ivailop7 opened this issue Dec 4, 2024 · 4 comments
Labels
tables Relates to Lexical Tables

Comments

@ivailop7
Copy link
Collaborator

ivailop7 commented Dec 4, 2024

Lexical 0.21

Applying alignment to a table doesn't take effect. Currently one cannot centre a table. I guess we are missing formatting properties on TableNode-level

@ivailop7 ivailop7 added the tables Relates to Lexical Tables label Dec 4, 2024
@etrepum
Copy link
Collaborator

etrepum commented Dec 5, 2024

In Firefox the CSS is such that the table is always full width, might make sense to tackle both at the same time if we are to support horizontal alignment for tables.

@ivailop7
Copy link
Collaborator Author

ivailop7 commented Dec 6, 2024

Oh wow, I didn't even realize we even have different CSS for Firefox...

@etrepum
Copy link
Collaborator

etrepum commented Dec 6, 2024

Well, the CSS is the same but Firefox does not render it the same way the other engines do. I think it regressed when the column width stuff was merged #6625 due to the width: fit-content instead of width: max-content.

@Ulop
Copy link
Contributor

Ulop commented Dec 17, 2024

Since there is no support at the library level, I solved the problem in my project with an additional TableWrapper node.

It wraps the table node in an additional div, with display: flex; flex-direction: column, and align-items according to ElementNode::getFormatType.

table_align.mp4

Works fine overall, but it would be nice to have an out-of-the-box solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tables Relates to Lexical Tables
Projects
None yet
Development

No branches or pull requests

3 participants