Table template

Table template

by Conn Warwicker -
Number of replies: 2
Picture of Core developers Picture of Plugin developers

Hi,

I'm trying to have my database entries displayed in a simple table, like the ones here: https://moodle.org/mod/data/view.php?id=6140


I have put my template header as:

<table>

<tr><th></th><th>Title</th><th>Author</th><th>Genre</th></tr>


The repeated entry is:

<tr><td>Cover Image</td><td>Title</td><td>Author</td><td>Genre</td></tr>


And the footer is:

</table>


However, when I save this, it does not save  the HTML properly. It saves the header as:

<table>

<tbody><tr><th></th><th>Title</th><th>Author</th><th>Genre</th></tr></tbody></table>


And it saves nothing in the Footer section. So the actual content of the list ends up having the header row in its own table, and then the entries are displayed outside of the table, not in table rows:

<table>

<tbody><tr><th></th><th>Title</th><th>Author</th><th>Genre</th></tr></tbody></table>

<a href="view.php?d=45&amp;rid=310"><img src="northernlights.jpg" alt="" title="" class="list_picture"></a>Northern LightsPhilip PullmanFantasy


Is there some other way I should be doing this, to create a table of entries?


Average of ratings: -
In reply to Conn Warwicker

Re: Table template

by William Lu -
Picture of Particularly helpful Moodlers

You must 'Disable editor' before you are going to add your own code. And make sure you keep the editor disabled before you click the 'Save' button.

 

Please use the attached preset to save your time.

To view what is hidden in the preset, DISABLE EDITOR  first smile

HTH

Average of ratings: Useful (1)