In my custom module I am saving data from front and it will display in the admin something like inquiry.

In admin side edit form I have to display some products data in table.

For example customer fill Name, Email, Message and multiple products Id.

so in Admin when we edit record from grid it will be like

Name: Test
Email : [email protected]
Message: Message
Product Data : 
        <tr><th>Product ID</th><th>Product Name</th></tr>
        <tr><td>1</td><td>Product 1</td></tr>
        <tr><td>2</td><td>Product 2</td></tr>
  • do you want to show html data in grid ? or in admin edit form ? Commented Jan 7, 2019 at 11:38
  • What is the structure of the table for this enquiry form? Commented Jan 7, 2019 at 11:53
  • @Magecode Please check my ans, its working fine for me : prnt.sc/m40xuo, so it should be work for you as wll Commented Jan 7, 2019 at 12:07

1 Answer 1


You can add your table HTML into "after_element_html" like following.

$fieldset->addField('some_id', 'text', [
     'name' => 'some_name',
     'label' => __('Some Label Here'),
     'readonly' => true,
     'after_element_html' => '<table>
                                <tr><th>Product ID</th><th>Product Name</th></tr>
                                <tr><td>1</td><td>Product 1</td></tr>
                                <tr><td>2</td><td>Product 2</td></tr>
  • @Magecode does this working for you ? Commented Jan 7, 2019 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.