JSFiddle - React, Tailwind, and code Playground

HTML

<table>
   <tr>
      <td class="ccol1">This is the HTML if its characters exceed 50 characters it should go to next line</td>
   </tr>
</table>

JavaScript

$( '.ccol1' ).each( function () {
                var str = $('td' + '.ccol1').html();

                var htmlfoo = str.match(/.{1,50}/g).join("<br/>");
                $( this ).html( htmlfoo );  
            });