Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Repeating Items : control the way it wraps

1638845024
Jiboux
Pro
Sheet Author
Compendium Curator
Hi, My custom sheet is meant to be used in several window width, so I have set the repeating fieldset set so that they use a second column whenever the width allows this... I managed to do this by ensuring the repitems are display inline-block It works almost as it should, except some user pointed out it is annoying that in wraps horizontally instead of vertically... When given enough width 1 2 3 4 Wraps into 1   2 3   4 Where somehow it would feel more logical to wrap 1  3 2  4 Any suggestion how to achieve this wrapping ?
1638845437

Edited 1638846019
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
you can use CSS multi-column layout. Simply do the following for your repcontainer: .repcontainer{ column-width:200px;//Set to whatever you want your min column width to be. A new column will be made any time there is enough room for a new full sized column } and remove any grid or flex settings you have setup for it. EDIT: Oh, one thing I should note is that the first two items to be added will stack in the first column, even though the spec for the feature says that they should go side by side.
1638846118
Jiboux
Pro
Sheet Author
Compendium Curator
Oh thanks so much Scott, it immediately arranged in the order I needed... Only thing I can't sort out, is that it seems to only work if the width is hardcoded, and not with a  column-width:auto.   Any way to avoid the hardcoded width as depending on which repitems it will force it to wrap ?
1638847409

Edited 1638847541
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
no, it needs a hard coded width in order to work. You're essentially giving it a minimum size for the column. You can alternatively specify a column-count, but then you lose the dynamic number of columns and instead get columns that resize to fill the space while keeping the same number. I'm assuming that you need different sizes for each repeating section. For that, I'd probably utilize css variables to simplify the code. That would look something like: .charsheet{ --columnWidth:200px; } .skills{ --columnWidth:100px; } .attacks{ --columnWidth:150px; } .abilities{ //default column width } .repcontainer{ column-width:var(--columnWidth); }
1638847564
Jiboux
Pro
Sheet Author
Compendium Curator
OK, thanks a lot for the support, it was worth a try, but I have too many repitems with different width to be able to hardcode...