control of List view columns

control of List view columns

by Janice Bogorad -
Number of replies: 6

Our Moodle was just updated from 2.6 to 2.9.3, and I can suddenly no longer control the width of table columns in the list view. Does anyone have any ideas as to how this has happened, and/or what I can/should do about it?

I have tried using both percentages and pixels, that both worked in 2.6. And I have also tried removing CSS code that I thought might be affecting it. The columns are presented exactly the same way, no matter how I define the width in HTML. Very strange.

Janice

Average of ratings: -
In reply to Janice Bogorad

Re: control of List view columns

by William Lu -
Picture of Particularly helpful Moodlers

Attach your preset here. I'd like to try it for you.

In reply to William Lu

Re: control of List view columns

by Janice Bogorad -

Something very strange is going on.

I wanted to send a smaller version of the database - the same fields, but fewer records - but the problem does NOT exist there. I assumed that I could find a difference in the code, and therefore find the source of the problem. However, the code seemed the same. Just to be certain, I copied all HTML, CSS & JavaScript code from the small database that DOES work correctly, and pasted it into the full database. And it STILL works wrong there. Sending a preset of the small database that works correctly will not help, so I will ask permission to post a copy of the full database. 

In reply to Janice Bogorad

Re: control of List view columns

by Janice Bogorad -

Since the problem seemed somehow data-related, I have been trying to list data in different orders, and showing a different number of records - and the width of the columns vary greatly when I do this on my full database.

I have tried adding more entries into the smaller database that DOES work correctly, and even when adding and viewing entries with extreme sizes of data, the columns stay the correct width.

This does not make sense to me, and I have not (yet) been able to find an explanation by searching through various definitions for the width settings. Can anyone enlighten me?


In reply to Janice Bogorad

Re: control of List view columns

by Janice Bogorad -

Here is my database with what I believe is a simple List view template defined. The column Widths seem to be data related here, although not in a very similar version of this database. Any guidance and/or help would be appreciated. I am not that well versed in this coding  or environment.

In reply to Janice Bogorad

Re: control of List view columns

by William Lu -
Picture of Particularly helpful Moodlers

Fixed.

1.  <tbody> must be in ‘Header area’, not in the ‘Repeated entry area’

2.  </tbody> must in 'Footer area', not in the ‘Repeated entry area’

3.   Text in Table header may push the <td> width more than 6% as you defined. Change the <td> width to a bigger number.

4.   Text in Table header may push the <td> width more you defined, try to use abbreviation or use <br> to create another line.

See attached preset.

HTH

In reply to William Lu

Re: control of List view columns

by Janice Bogorad -

Thank you for taking the time to try to help me, and I did learn some things.

However, most of these changes made no difference to the behavior, and the widths of the columns still changed depending on the data used.

I analyzed the behavior and the data in more detail, and I discovered that the problem stemmed from 3 records whose second column was too wide in a single "word" that could not be broken into multiple lines. I have moved this information to another field for these 3 records, as a workaround, and I will document this restriction for future use. The second column needs to be the most narrow, as it is usually much smaller than the others.

Janice