JSFiddle - React, Tailwind, and code Playground

by Mohsen Safari Roodbar

HTML

<div id="header_container">
    <div id="header">
        <div class="headimage">
            <a href="http://site.com/" target="_blank"><img src="http://placehold.it/300x80"/></a>
        </div>
        <select class="class-selector">
            <option value="">-select class-</option>
        </select>
        <div class="classcycler">
            <a id="NextClass" href="javascript: void(0);"><font color=#EFEFEF>Next Class</font></a> <font color=red>|</font> <a id="PreviousClass" href="javascript: void(0);"><font color=#EFEFEF>Previous Class</font></a>
        </div>
        <div class="headmid">
            Semi-Transparent Image <a href="#TOP"><font color=#EFEFEF>Up to Top</font></a> | <a href="#KEY"><font color=#EFEFEF>Down to Key</font></a>
        </div>
    </div>
</div>
<a id="TOP"></a>
<div id="container">
    <table id="gradient-style">
        <tbody>
            <thead>
                <tr>
                    <th scope="col"><a id="CLASS1"></a>Class 1</th>
                    <th scope="col">Class 1</th>
                    <th scope="col">Class 1</th>
                    <th scope="col">Class<br>Test 1</th>
                    <th scope="col">Class 1</th>
                    <th scope="col">Class 1</th>
                    <th scope="col">Class 1</th>
                    <th scope="col">Class Data 1</th>
                    <th scope="col">Class 1<br>Class 1</th>
                    <th scope="col">Class 1</th>
                    <th scope="col">Class 1<br>Class 1</th>
                    <th scope="col">Class 1</th>
                    <th scope="col">Class 1</th>
                    <th scope="col">Class 1</th>
                    <th scope="col">Class 1</th>
                    <th scope="col">Class 1</th>
                    <th scope="col">Class 1 Class 1</th>
                    <th scope="col">title text<br> data text</th>
                    <th scope="col">title text<br> data text</th>
                    <th scope="col">title text</th>
...

CSS

body {
    line-height: 1.6em;
    background-color: #535353;
    overflow-x: scroll;
}

#gradient-style {
    font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
    font-size: 12px;
    margin: 0px;
    width: 100%;
    text-align: center;
    border-collapse: collapse;
}

#gradient-style * {
    white-space: nowrap;
}

#gradient-style th {
    font-size: 13px;
    font-weight: normal;
    line-height: 250%;
    padding-left: 5px;
    padding-right: 5px;
    background: #535353 url('table-images/gradhead.png') repeat-x;
    border-top: 1px solid #fff;
    border-bottom: 1px solid #fff;
    color: #ffffff;
}

#gradient-style th.alt {
    font-family: "Times New Roman", Serif;
    text-align: left;
    padding: 10px;
    font-size: 26px;
}

#gradient-style td {
    padding-left: 5px;
    padding-right: 5px;
    border-top: 1px solid #fff;
    border-bottom: 1px solid #fff;
    border-left: 1px solid #fff;
    border-right: 1px solid #fff;
    color: #00000;
    background: #FFF url('table-images/gradback.png') repeat-x;
}

#gradient-style tr.ft3 td {
    color: #00000;
    background: #99cde7 url('table-images/gradoverallstudent.png') repeat-x;
    font-weight: bold;
}

#gradient-style tr.f1 td {
    color: #00000;
    background: #99cde7 url('table-images/gradbeststudent.png') repeat-x;
}

#gradient-style tr.f2 td {
    color: #00000;
    background: #b7e2b6 url('table-images/gradmostattentedstudent.png') repeat-x;
}

#gradient-style tr.f3 td {
    color: #00000;
    background: #a9cd6c url('table-images/gradleastlatestudtent.png') repeat-x;
}
#footer .footleft a{
    width:100px;
    height:47px;
    display:block;
}
#gradient-style tfoot tr td {
    background: #6FA275;
    font-size: 12px;
    color: #000;
    padding: 10;
    text-align: left;
}

#gradient-style tbody tr:hover td,
#gradient-style tbody tr.selected td {
    background: #d0dafd url('table-images/gradhover.png') repeat-x;
    color: #339;
}

body {
    margin: 0;
    padding:...

JavaScript

$(document).ready( function() {

    for (var i=0;i<($("table").children().length);i++){
        if(readCookie(i))
            $($($("table").children()[i]).children()[(readCookie(i))]).toggleClass('selected').siblings().removeClass('selected');
    }
    $("tr").click(function(){
        $(this).toggleClass('selected').siblings().removeClass('selected');
        if(readCookie($(this).parent().index())){
            if(readCookie($(this).parent().index())==$(this).index())
                eraseCookie($(this).parent().index());
            else{
                eraseCookie($(this).parent().index());
                createCookie($(this).parent().index(),$(this).index(),1);
            }
        }
        else
            createCookie($(this).parent().index(),$(this).index(),1);
    });

    var currentClass = 0;
    $("#PreviousClass").click(function(){if(currentClass>1)currentClass--;$('.class-selector').val("CLASS"+currentClass);scrollToAnchor("CLASS"+currentClass);});
    $("#NextClass").click(function () {
        if(currentClass != 3) {
            if(currentClass < 3) currentClass++;
            $('.class-selector').val("RACE" + currentClass);
            scrollToAnchor("RACE" + currentClass);
        }
    });
    
    // gather CLASS info
    var selector = $('.class-selector').on('change', function(){
        var id = this.value;
        if (id!==''){
            scrollToAnchor(id);
        }
    });
    $('a[id^="CLASS"]').each(function(){
        var id = this.id,
            option = $('<option>',{
                value: this.id,
                text:this.id
            });
        selector.append(option);
    });


    function scrollToAnchor(aid) {
        var aTag = $("a[id='" + aid + "']");
        $('html,body').animate({
            scrollTop: aTag.offset().top - 80
        }, 1);
    }

    $("a.TOPJS").click(function () {
        scrollToAnchor('TOP');
    });

    $("a.KEYJS").click(function () {
        scrollToAnchor('KEY');
    });

   ...