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

tables with similar data do not have same width columns #88

Open
zebapy opened this issue Jan 24, 2018 · 7 comments
Open

tables with similar data do not have same width columns #88

zebapy opened this issue Jan 24, 2018 · 7 comments
Assignees

Comments

@zebapy
Copy link
Contributor

zebapy commented Jan 24, 2018

It would be nice to have a way for these to line up when they are separate tables.

Possibly we could use data attributes to do something like data-table-group="UNIQUEID" which would use JS to make column widths the same. Otherwise we'd need css width classes whitelisted or similar.

https://www.middlebury.edu/institute/academics/degree-programs/international-education-management/curriculum

screenshot 2018-01-24 13 54 19

@kettlestitch you brought this up to me awhile back and Darcy just reminded me. I'm just opening an issue in case we want to look at it later on.

@ghost
Copy link

ghost commented Sep 14, 2018

@zebapy I think this would still be good to look at. Might be used more as we build out the other sites, so a fix would be good to have.

@zebapy
Copy link
Contributor Author

zebapy commented Sep 14, 2018

So I can set all tables to have table-layout:fixed which makes them maintain column widths
screenshot 2018-09-14 13 35 27
but it affects all tables on page (granted this one should be a dl but I don't know about other pages)
screenshot 2018-09-14 13 35 22

So we'd need to whitelist a data attribute (any harm in white listing any data attributes?) which would have to be applied to tables in source code..

Or we figure out a good editor option to address the problem (a Table component 🤐 with checkbox for fixed layout or not?)

@ghost
Copy link

ghost commented Sep 18, 2018

So the solution is taking the number of columns and giving them each an equal width? It solves the problem, but it looks odd in your first example. Could you add a class override sort of thing? Col-2, Col4 sort of thing?

@zebapy
Copy link
Contributor Author

zebapy commented Sep 18, 2018

Was there not hesitancy to allow classes in the wysiywg?

I was thinking of trying to create some javascript that would determine the widest cell of the same column across a group of tables (determined by the editor?), then set each to that width, and repeat for the other columns. I think that would work.

@ghost
Copy link

ghost commented Sep 18, 2018 via email

@zebapy
Copy link
Contributor Author

zebapy commented Sep 18, 2018

What sort of editor experience do we want for this? Are we ok with someone needing to add data-table-group attributes? Assuming something like this would only be needed on high profile pages that someone of our team would be editing.

@ghost
Copy link

ghost commented Sep 18, 2018 via email

@zebapy zebapy self-assigned this Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant