Displaying tables with mustache templates

Re: Displaying tables with mustache templates

by Richard Oelmann -
Number of replies: 0
Picture of Core developers Picture of Plugin developers Picture of Testers
The 'moodle table design' is just html, with the design elements from the SCSS/theme (courtesy of Bootstrap). So putting an html table with the appropriate classes should pick up all the design elements anyway.
To place it alongside something else in a structure, just put it inside the relevant element that is sized appropriately by your flex container and the table will size to fit (noting tables are not particularly responsive themselves).
UNLESS - what you are actually asking is how to fit an already existing complete Moodle table into a flex element?
In which case you will need to find the output renderer that creates and populates that table and pass that as an element into your mustache template - there are plenty of examples of $OUTPUT->[someclass] being passed into renderers that you could follow for that. Being a table isn't particularly relevant to that approach.
Average of ratings: Useful (1)