OK, the problem is that the look you get with the default template for 'view list' is not the one I want. The one I want is the most logical one (the one we have in the databases at moodle.org:
What can I do to get a single table header? As you see, if I add the table header in the template table, it shows for every record. If I eliminate it from there, it doesn't show anywhere. Also, the contents of the cells are not aligned either and I don't know how to get them aligned.
Any help you might offer will be greatly welcome.
So your table headers go in the top one.
Since I wanted to reproduce the particular layout in the databases at moodle.org, I modified the table in the 'List template' to look like the following:
|##Edit## ##More## ##Delete## ##Approve##|
I've managed to fix the alignment since the last screenshot, but I still get the headers repeated for every record:
What am I doing wrong? The table headers are in the top row and yet they are repeated for every record in 'view list'. And, while we are at it, how do I do it so that the first one of the fields take you to the 'view single' when you click it? This is what happens in the three databases in moodle.org and I find it really useful. Again, any help you guys can give me with this will be greatly appreciated.
Make sure you are using the list template. It indeed has a configurable number of fields. But above the fields is a header template and below it is a footer template. Both are only shown once for each list. Place the table and table header tags inside those two fields and they won't be repeated.
<table width="60%" border="1" align="center" cellspacing="0" cellpadding="0" bordercolor="#CCCCCC"> <tr><td>Bestand</td><td>Beschrijving<td>Datum</td><Bewerk></tr>
for each entry:
I think it is wiser to temporarily turn off the HTML editor doing this, because the database templates are not exactly compatible with the HTML editor. I answered this same message in the Dutch forum to another user who, like you, is quite experienced using computers. I have the feeling this whole database module was released too early.
It looks like you need all the HTML code for a complete table in both windows (header and repeated entry), though. If I do exactly what you say and don't start the table in the 'repeated entry' window with <table> and end it with </table>, it won't be accepted. Even if I place </table> in the footer. The moment I return to wysiwyg all the HTML code has disappeared. This is what you must mean when you say that the database templates are not compatible with the HTML editor.
What I did to solve the problem was to introduce a complete table in each window. But then the problem I had is that the different cells got resized according to their contents and wound up not being properly aligned. What I did then was to get a fixed width in pixels for every cell in both tables and that seems to work all right. I wonder if it would be possible to use external CSS styles for all the layout in the database module. This would make things easier when you have to create many databases.