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>
        <td class="ccol1">This is the HTML if its characters exceed 50 characters it should go to next line. And another line must show.</td>
    </tr>
</table>

CSS

td {
    border: 1px solid black;
}

JavaScript

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

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