How to add a form to a table?

How to add a form to a table?

by Xiu-Fong Lin -
Number of replies: 1

Hi guys

Im struggling with something really simple, please help me.

I need to add a form button with a hidden to a table with all the students, i tried to do the form and add it to the table inside like a data field and the result was this:

The buttons should be inside the table.

Any ideas?

Thanks in advance

Average of ratings: -
In reply to Xiu-Fong Lin

Re: How to add a form to a table?

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

If you're trying to use an mform, then the trouble you're having is that the display() method outputs the form directly, rather than just returning the HTML for inclusion within another element.

The simplest solution to your problem is probably to use $OUTPUT->single_button() inside each table row.