0

I installed TinyMCE editor on my Laravel application. I want to write HTML in my TinyMCE, like

  • or per example.

    Here is the code I put in TinyMCE :

    <table class="table table-dark">
      <thead>
        <tr>
          <th scope="col">#</th>
          <th scope="col">First</th>
          <th scope="col">Last</th>
          <th scope="col">Handle</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row">1</th>
          <td>Mark</td>
          <td>Otto</td>
          <td>@mdo</td>
        </tr>
        <tr>
          <th scope="row">2</th>
          <td>Jacob</td>
          <td>Thornton</td>
          <td>@fat</td>
        </tr>
        <tr>
          <th scope="row">3</th>
          <td>Larry</td>
          <td>the Bird</td>
          <td>@twitter</td>
        </tr>
      </tbody>
    </table>
    

    So I dit it and I print the result like that :

        <p>{!!html_entity_decode($vpn->intro)!!}</p>
    

    Here is the result :

    result

    Can you help me to solve the problem please ?

  • Lien Lien
    • 139
    • 2
    • 13
    • Does `$vpn->intro` have the table you shared only? Also why are you doing `html_entity_decode` ? – apokryfos Feb 04 '21 at 13:22
    • You can't put direct html code in TinyMCE, For this, you need to install **html editor code** plug-in https://www.tiny.cloud/docs/plugins/opensource/code/ – STA Feb 04 '21 at 13:23

    1 Answers1

    0

    <table> does not allowed to be printed inside <p>, Use <div> instead.

    <div>
    {!!html_entity_decode($vpn->intro)!!}
    </div>
    

    Here you can find out why.

    Miqayel Srapionyan
    • 587
    • 2
    • 5
    • 15