How to add Custom table next to product attribute in a product detail page

enter image description here

  • What u want to show in the table? Oct 15, 2019 at 8:13
  • @HafizArslan I need to show hard coded html tags
    – Dev Space
    Oct 15, 2019 at 17:47

1 Answer 1


Create a Block in Admin site (like: Identifier is 'table') add HTML tags what u want.

Create a file, name is table.phtml


echo $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('table')->toHtml();

Then call the file in catalog_product_view.xml


<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <block class="Magento\Catalog\Block\Product\View" name="table"
             template="Magento_Catalog::product/view/table.phtml" >
       <move element="table" destination="product.info.main" after="product.info.stock.sku"/>

After that running these commands:

sudo php bin/magento setup:upgrade
sudo php bin/magento setup:di:compile
sudo php bin/magento cache:clean
sudo php bin/magento cache:flush

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .