How to add a form to a table?

How to add a form to a table?

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

評比平均分數: -
In reply to Xiu-Fong Lin

Re: How to add a form to a table?

Mark Johnson發表於
Core developers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 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.