JSFiddle - React, Tailwind, and code Playground

by ggChris

HTML

<div class="wrapper1">
    <div class="scrollTop"></div>
</div>
<div class="tableData">
    <table>
        aaaa bbbb cccc dddd aaaa bbbb cccc dddd aaaa bbbb cccc dddd aaaa bbbb cccc dddd aaaa bbbb cccc dddd aaaa bbbb cccc dddd aaaa bbbb cccc dddd
    </table>
</div>

CSS

.wrapper1, .tableData{width: 100%; border: none 0px RED;
overflow-x: scroll; overflow-y:hidden;}
.tableData {box-shadow: 10px 10px 5px #000;

    -webkit-border-radius: 25px;
    -moz-border-radius: 25px;
    border-radius: 25px;}
.wrapper1{height: 20px; }
.tableData{height: 200px; }
.scrollTop {width:1000px; height: 20px; }
table {width:1000px; height: 200px;
overflow: auto;}

JavaScript

$(function(){
    $(".wrapper1").scroll(function(){
        $(".tableData").scrollLeft($(".wrapper1").scrollLeft());
    });
    $(".tableData").scroll(function(){
        $(".wrapper1").scrollLeft($(".tableData").scrollLeft());
    });
});