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

Is it possible to achieve flex-wrap like layout? #669

Closed
Nervniyak opened this issue Jun 11, 2020 · 3 comments
Closed

Is it possible to achieve flex-wrap like layout? #669

Nervniyak opened this issue Jun 11, 2020 · 3 comments
Labels

Comments

@Nervniyak
Copy link

Nervniyak commented Jun 11, 2020

Here's example of what I'd like to achieve:
image

So basically:

  • all cells are equally important, they all contain generalized content of any type.
  • columns proportions are not preserved as cells can be shorter or wider and it doesn't depend on rows above or below.
  • the amount of cells per row is not constant.
  • the cell can carry over to next row if there is no space left for it on current row .

I know it is kinda against the table layout, but maybe it is possible somehow? Right now I have to make the width of 4 columns fixed and equal. So I waste a lot of space this way, short data get's more space than it needs, long data has to be squished, and the amount of cells in each row is constant.

Example of how currently my layout looks like:
image

Partial solution would be to give cells which are considered having longer data a colspan of 2 or 3 cells

Any suggestions?

@mmghv
Copy link
Collaborator

mmghv commented Jun 11, 2020

As you said it, this is totally against the table layout, the column concept is gone, in HTML this can't be done with tables, it needed a whole new concept (flex layout).

So if you can't do it with HTML tables, you certainly can't do it with AutoTable.

Although I'm wondering why you're giving a fixed & equal width to all columns, it you let it to be auto, it will give most width to the longest content column, but in your example you have some sort of a long hash/path with no spaces that AutoTable will treat as one word and cause it not to wrap, so you may need to set minCellWidth for other columns.

@Nervniyak
Copy link
Author

Understood.

I will try to use minCellWidth to improve current behavior, but it would've been great if there was maxCellWidth, this way it would be possible to limit the expansion of one cell, but also possible for empty cells to take minimum or 0 width.

@mmghv
Copy link
Collaborator

mmghv commented Jun 11, 2020

but it would've been great if there was maxCellWidth

I agree, maybe we could add it in the future.

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

No branches or pull requests

2 participants