Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to insert image in the table using Markdown

How to insert image in the table using Markdown

Normal html syntax works fine, but the markdown syntax returns as table data,

Please suggest any answers

Normal HTML

# Image inside a Table
<table>
    <tr>
        <td>
            Image inside Table
        </td>

        <td>
        <img src="image.jpg"></img>
        </td>
    </tr>

Markdown

# Image inside a Table
<table>
    <tr>
        <td>
            Image inside Table
        </td>

         <td>
        ![](image.jpg)

        </td>
    </tr>


1 Answers

The rules state:

Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can’t use Markdown-style *emphasis* inside an HTML block.

Therefore, everything between the <table> and </table> tags is ignored by Markdown. That being the case, if you are using raw HTML for the table, you must use HTML for all of the content of said table.

There are a few unofficial workarounds which depend on the Markdown implementation you are using.

  1. Some implementations provide a mechanism to tell the parser to not ignore Markdown text inside an HTML block. The most common is to set markdown=1 as an attribute on the block tag. Some implementations include this feature by default. Others provide the feature through a plugin/extension. And Some require you to enable it globally through an API hook (programmatically).

  2. Some implementations provide a table syntax which is defined using plain text rather than HTML (usually through a plugin/extension). As the table itself is Markdown, everything in it is as well. However, the specifics of the syntax vary from implementation to implementation.

As both of the above solutions depend on which Markdown implementation you are using, and you didn't tell us that, all I can do is suggest you check the documentation for the implementation you are using.

like image 78
Waylan Avatar answered Sep 02 '26 22:09

Waylan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!