JSFiddle - React, Tailwind, and code Playground

HTML

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/datatables/1.10.0/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="//cdn.datatables.net/1.10.0/css/jquery.dataTables.css">
<table id="myTable">
    <thead>
        <tr>
            <th>Col 1</th>
            <th>Col 2</th>
            <th>Col 3</th>
            <th>Col 4</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Sam</td>
            <td>10</td>
            <td>Left</td>
            <td>Blue</td>
        </tr>
        <tr>
            <td>Mike</td>
            <td>8</td>
            <td>Right</td>
            <td>Red</td>
        </tr>
        <tr>
            <td>Joe</td>
            <td>3</td>
            <td>Left</td>
            <td>Blue</td>
        </tr>
    </tbody>
</table>

<script type="text/template" id="child_table">
    <table>
        <thead>
            <tr>
                <th>Col 1</th>
                <th>Col 2</th>
                <th>Col 3</th>
                <th>Col 4</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Jen</td>
                <td>100</td>
                <td>Left</td>
                <td>Pink</td>
            </tr>
            <tr>
                <td>Sal</td>
                <td>88</td>
                <td>Right</td>
                <td>Green</td>
            </tr>
        </tbody>
    </table>    
</script>

<button id="createChild">Create Child</button>

JavaScript

$(document).ready(function(){
    var myDataTable = $('#myTable').DataTable({
        "order":[],
    });
    
    $('#createChild').click(function(e){
        e.preventDefault();
        var $table = $($('#child_table').html());
        $table.css('width','100%');
        $table.DataTable();
        myDataTable.row(0).child($table).show();
    });
});