-
Notifications
You must be signed in to change notification settings - Fork 32
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
New plugin : align columns ! #191
New plugin : align columns ! #191
Conversation
Pull Request Test Coverage Report for Build 7996968572Details
💛 - Coveralls |
4364ee2
to
2f595ba
Compare
2f595ba
to
fb925fb
Compare
This is really cool! I'm already struggling to maintain the existing plugins as is right now, so I'm a bit weary to add it to the core set of plugins, but I would love to add a section in the documentation pointing to the plugin examples! |
Totally understandable! I will polish it and release as a standalone package. If you have any feedback or ideas feel free! :) ✌️ |
Hi @lolcabanon! I'm getting my head around plugins and came across your post - Table Columns not aligning is driving me crazy. Was wondering if your plugin is available to try and use? |
Hey @hgoona! https://github.com/lolcabanon/add-aligned-columns It's pinned on my profile. :) It is really experimental for now, but I am using it in a project of mine. Don't hesitate to provide feedback as I don't really know how i'd like the final API design! Currently the alignment toggling does not work reactively for For the docs, I have not written it yet but will do. Look at the code and |
Oh I see! Thanks! ..I can pnpm install this plugin? |
Yes you can Since it's in an early stage, the best way to see it in action is to clone the repo and run it.
Then go to Look in |
@lolcabanon I just had a look and I think I got it working! Is it only for changing the alignment of text inside the row? What does 'alignOn' do? I've got rows and sub rows/expanded rows with different schemas, and I'm finding that even though the sub rows header labels are the same length, the columns are all sorts of varying widths. It's driving me wild haha does your plugin solve this? Or is there another way to solve this? |
Maybe you need to set explicitely As for my plugin, it aligns the text inside columns like so :
I think I removed it in This post was made even before |
Ah I see. Ok I have your plugin working @lolcabanon 👍🏾 but it turns out i don't need it 😅 and it seems the block, but then when rendering completes all the initialWidths/max/minWidths set from the resize plugin become changed to different values.. |
I can use the |
from the render of pre with |
hey @lolcabanon are you on Svelte 4? I'm still having issue with the Is it possible to take a glance at my REPL to see what I've done wrong? >>>https://svelte.dev/repl/aebed9b9f2ad441e90a1163ab4f5cd6d?version=3.48.0 @bryanmylee would greatly appreciate your insight on this? |
Added a plugin to manage columns alignment.
I think I found a neat API and behavior, but it's not final as-is. I'm open to suggestions, and would also need to create the docs accordingly.
How it works
Simply apply
text-align: ${alignment}
to cells.Table Options
Default Alignment
Set default alignment for table. Columns without
alignment
property will use the default if notdisabled
.Toggle Order
Set alignment order.
A final column toggle order will be [ columnOptions.alignment, ...toggleOrder ];
Column Options
Alignment
Initial column alignment.
Align Head
Does the
th
align? If not, onlytd
cells align.Disable
Disable alignment completely for the moment.
I'd like this option to disable toggling only, while allowing to set an initial value.
Usage