JSFiddle - React, Tailwind, and code Playground

by Dragan Gaić

HTML

<!DOCTYPE html>
<html>
    <head>
        <title>jQM Complex Demo</title>
        <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
        <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no; target-densityDpi=device-dpi"/>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css" /> 
        <!--<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>-->
        <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>    
    </head>
    <body>     
        <div data-role="page" id="index" data-theme="a" >
            <div data-role="header">
                <h3>
                    First Page
                </h3>
                <a href="#second" class="ui-btn-right">Next</a>
            </div>
            
            <div data-role="content">
                <table data-role="table" id="my-table" data-mode="reflow">
                    <thead>
                        <tr>
                            <th>Rank</th>
                            <th>Movie Title</th>
                            <th>Year</th>
                            <th><abbr title="Rotten Tomato Rating">Rating</abbr></th>
                            <th>Reviews</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <th>1</th>
                            <td><a href="foo.com" data-rel="external">Citizen Kane</a></td>
                            <td>1941</td>
                            <td>100%</td>
                            <td>74</td>
                        </tr>
                    </tbody>
                </table>
            </div>
            
            <div data-role="footer" data-position="fixed">
                
            </div>
        </div> 
    </body>
</html>

JavaScript

$(document).on('pagecontainershow', function (e, ui) {
    var activePage = $(':mobile-pagecontainer').pagecontainer('getActivePage').attr('id');
    if(activePage === 'index') {
        $('<tbody><tr><th>2</th><td><a href="foo.com" data-rel="external">Blow up</a></td><td>1958</td><td>100%</td><td>12</td></tr></tbody>').appendTo('#my-table');  
        $( "#my-table" ).table( "rebuild" );
    }
});