JSFiddle - React, Tailwind, and code Playground
HTML
<div id="header_container">
<div id="header"> <a href="http://site.com/" target="_blank"><img src="http://placehold.it/300x80"/></a>
<select class="class-selector">
<option value="">-select class-</option>
</select>
<div id="header1">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> | <a class="def" href="javascript: void(0);"><font color="#EFEFEF">Scroll Left</font></a> | <a class="abc" href="javascript: void(0);"><font color="#EFEFEF">Scroll Right</font></a>
</div>
</div>
</div>
<a id="TOP"></a>
<div id="container">
<table id="gradient-style" cellpadding="0" cellspacing="0" border="0">
<tbody>
<thead>
<tr>
<th scope="col"><a id="CLASS1"></a>title</th>
<th scope="col">title</th>
<th scope="col">title</th>
<th scope="col">Class</th>
<th scope="col">Class Number</th>
<th scope="col">title text</th>
<th scope="col">title text</th>
<th scope="col">title text</th>
<th scope="col">title text
<br/>data text</th>
<th scope="col">title text</th>
<th scope="col">title text
<br/>data text</th>
<th scope="col">title text</th>
<th scope="col">title text</th>
<th scope="col">text</th>
<th scope="col">title text</th>
<th scope="col">title text</th>
<th scope="col">title text
<br/>data text</th>
<th scope="col">title text
<br/>data text</th>
<th scope="col">title text
<br/>data text</th>
...
CSS
/*NEW ADDITIONS TO CSS*/
td, th {
white-space:nowrap;
}
#header .class-selector {
left: 0;
position: absolute;
}
/*OLD CSS*/
body {
line-height: 1.6em;
background-color: #0aad9e;
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 th {
font-size: 13px;
font-weight: normal;
padding: 2px;
background: #0aad9e 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: 2px;
border-bottom: 1px solid #fff;
border-left: 1px solid #fff;
border-right: 1px solid #fff;
color: #00000;
border-top: 1px solid #fff;
background: #ad750a url('table-images/gradback.png') repeat-x;
}
#gradient-style tr.ft3 td {
color: #00000;
background: #ad0a7d url('table-images/gradoverallstudent.png') repeat-x;
font-weight: bold;
}
#gradient-style tr.f1 td {
color: #00000;
background: #ad0a7d url('table-images/gradbeststudent.png') repeat-x;
}
#gradient-style tr.f2 td {
color: #00000;
background: #7f0aad url('table-images/gradmostattentedstudent.png') repeat-x;
}
#gradient-style tr.f3 td {
color: #00000;
background: #71ad0a url('table-images/gradleastlatestudtent.png') repeat-x;
}
#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: 0;
}
#header_container {
background: #0c0aad url('table-images/gradhead.png')...
JavaScript
$(document).ready(function () {
$("tr").click(function () {
$(this)
.toggleClass('selected')
.siblings()
.removeClass('selected');
});
// 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');
});
$("a.abc").click(function () {
$('#container').animate({
"scrollLeft": "-=204"
}, 200);
});
$("a.def").click(function () {
$("#container").animate({
"scrollLeft": "+=204"
}, 200);
});
});