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 section not working on a new sheet

1511907917
Andreas J.
Forum Champion
Sheet Author
Translator
So I have a sheet that I wanted repeating sections for, but it didn't quite work out and couldn't find any previous mention of similar issues: It might have to do with how the filedsets are made over a few cells but I'm not sure:     <table class="sheet-c19"><!-- Equippment & gear-->         <tbody>             <tr class="sheet-c5">                 <td class="sheet-c21 sheet-c41" colspan="3" rowspan="1">                     <p class="sheet-c13"><span class="sheet-c2">EQUIPMENT</span></p>                 </td>                 <td class="sheet-c30" colspan="1" rowspan="1">                     <p class="sheet-c17"><span class="sheet-c9 sheet-c18"></span></p>                 </td>                 <td class="sheet-c21 sheet-c67" colspan="3" rowspan="1">                     <p class="sheet-c13"><span class="sheet-c2">GEAR</span></p>                 </td>             </tr>             <tr class="sheet-c5">                 <td class="sheet-c12" colspan="1" rowspan="1">                     <p class="sheet-c13"><span class="c0">EQUIPMENT</span></p>                 </td>                 <td class="sheet-c24 sheet-c53" colspan="1" rowspan="1">                     <p class="sheet-c13"><span class="c0">NOTES</span></p>                 </td>                 <td class="sheet-c65 sheet-c24" colspan="1" rowspan="1">                     <p class="sheet-c13"><span class="c0">WT</span></p>                 </td>                 <td class="sheet-c30" colspan="1" rowspan="1">                     <p class="sheet-c17"><span class="sheet-c9 sheet-c18"></span></p>                 </td>                 <td class="sheet-c52 sheet-c24" colspan="1" rowspan="1">                     <p class="sheet-c13"><span class="c0">GEAR</span></p>                 </td>                 <td class="sheet-c24 sheet-c64" colspan="1" rowspan="1">                     <p class="sheet-c13"><span class="c0">NOTES</span></p>                 </td>                 <td class="sheet-c24 sheet-c56" colspan="1" rowspan="1">                     <p class="sheet-c13"><span class="c0">WT</span></p>                 </td>             </tr>             <tr class="sheet-c5"> <fieldset class="repeating_eq">                 <td class="sheet-c59" colspan="1" rowspan="1">                     <p class="sheet-c17"><span class="sheet-c1"></span><input style="width:99%;" type="text" name="attr_eqname" value="name"></p>                 </td>                 <td class="sheet-c53" colspan="1" rowspan="1">                     <p class="sheet-c17"><span class="sheet-c1"><input style="width:99%;" type="text" name="attr_eqnotes" value="notes"></span></p>                 </td>                 <td class="sheet-c65" colspan="1" rowspan="1">                     <p class="sheet-c17"><span class="sheet-c1"><input style="width:99%;" type="number" name="attr_eqweight" value="1"></span></p>                 </td> </fieldset>                 <td class="sheet-c30" colspan="1" rowspan="1">                     <p class="sheet-c17"><span class="sheet-c1"></span></p>                 </td> <fieldset class="repeating_gear">                 <td class="sheet-c52" colspan="1" rowspan="1">                     <p class="sheet-c17"><span class="sheet-c1"></span><input style="width:99%;" type="text" name="attr_gearname" value="name"></p>                 </td>                 <td class="sheet-c64" colspan="1" rowspan="1">                     <p class="sheet-c17"><span class="sheet-c1"></span><input style="width:99%;" type="text" name="attr_gearnotes" value="notes"></p>                 </td>                 <td class="sheet-c56" colspan="1" rowspan="1">                     <p class="sheet-c17"><span class="sheet-c1"></span><input style="width:99%;" type="number" name="attr_gearweight" value="1"></p>                 </td> </fieldset>             </tr>         </tbody>     </table> The sheet is imported to html from a google doc file, hence the awful class naming convention.
1511943914

Edited 1511960311
Jakob
Sheet Author
API Scripter
Here's what happens to a repeating fieldset, which looks like this in the sheet html <fieldset class="repeating_stuff"> CONTENT </fieldset> in the actual html in the roll20 app: <fieldset style="display:none" class="repeating_stuff"> CONTENT </fieldset> <div class="repcontainer ui-sortable" data-groupname="repeating_stuff"> <div class="repitem" data-reprowid="-abcdef"> <div class="itemcontrol"> <button class="btn btn-danger pictos repcontrol_del">#</button> <a class="btn repcontrol_move">≡</a> </div> CONTENT </div> <!-- And so on, one div.repitem for each repeating row --> <div class="repitem" data-reprowid="-xyz123"> <div class="itemcontrol"> <button class="btn btn-danger pictos repcontrol_del">#</button> <a class="btn repcontrol_move">≡</a> </div> CONTENT </div> </div> <div class="repcontrol" data-groupname="repeating_stuff"> <button class="btn repcontrol_edit">Modify</button> <button class="btn repcontrol_add">+Add</button> </div> So your row content gets wrapped into divs and doesn't participate in the table layout like you think it would. You cannot use HTML tables for repeating rows like that ( though a CSS table layout targeting the .repitem divs might work;   EDIT: no it won't).
1511950163
Andreas J.
Forum Champion
Sheet Author
Translator
So if I mash together the contents in the cells into one section and wrap the fieldset around it,having no table content inside, it should work? Something like this: <tr class="sheet-c5"> <td class="sheet-c59" colspan="3" rowspan="1"> <fieldset class="repeating_eq">                     <p class="sheet-c17"><span class="sheet-c1"><input style="width:100px;" type="text" name="attr_eqname" value="name"></span></p>                     <p class="sheet-c17"><span class="sheet-c1"><input style="width:120px;" type="text" name="attr_eqnotes" value="notes"></span></p>                     <p class="sheet-c17"><span class="sheet-c1"><input style="width:40px" type="number" name="attr_eqweight" value="1"></span></p>                </fieldset> </td>         <td class="sheet-c30" colspan="1" rowspan="1">             <p class="sheet-c17"><span class="sheet-c1"></span></p>         </td> <td class="sheet-c52" colspan="3" rowspan="1"> <fieldset class="repeating_gear">                     <p class="sheet-c17"><span class="sheet-c1"><input style="width:100px;" type="text" name="attr_gearname" value="name"></span></p>                     <p class="sheet-c17"><span class="sheet-c1"><input style="width:120px;" type="text" name="attr_gearnotes" value="notes"></span></p>                     <p class="sheet-c17"><span class="sheet-c1"><input style="width:40px;" type="number" name="attr_gearweight" value="1"></span></p>            </fieldset> </td> </tr>
1511952126
Jakob
Sheet Author
API Scripter
You're using tables for layout, which is not optimal practice. But leaving that aside, something like this should probably work. You'll probably want some extra CSS for formatting each of the rows such that it looks like a row in your table.
1511954965
Andreas J.
Forum Champion
Sheet Author
Translator
Yeah most of the things in that sheet isn't optimal, as the sheet is a html-converted google doc(wanted to get the layout of the original sheet fast), but though it was a bit better than starting from scratch as the newbie I am. Won't probably do it again this way. Thanks for the help Jacob. I think some of these footnotes about how repeating sections work could be added to the wiki, as it is now it doesn't tell anything about this. And are there any place to easier see the actual implementation on how col-section and other classes work in Roll20? 
1511959533
Jakob
Sheet Author
API Scripter
Yeah most of the things in that sheet isn't optimal, as the sheet is a html-converted google doc(wanted to get the layout of the original sheet fast), but though it was a bit better than starting from scratch as the newbie I am. Won't probably do it again this way. The quick and easy path leads to the dark side .... (sorry, couldn't help it with your avatar). Thanks for the help Jacob. I think some of these footnotes about how repeating sections work could be added to the wiki, as it is now it doesn't tell anything about this. And are there any place to easier see the actual implementation on how col-section and other classes work in Roll20? You're right, something like this probably should  go into the wiki (with a bit more detail). Unfortunately, many of the more subtle aspects of how character sheets work are not very well documented, so it's more or less folklore knowledge at this point. I don't know what you mean by col-section, but I would say that at this point, the best place to see how things work is the browser's dev tools, which is probably not optimal; some good documentation would go a long way towards helping new sheet developers avoid roll20-specific mistakes (on top of beginner HTML/CSS mistakes).