Double Table in HTML
Go to solution
Solved by Guest,
I have worked it out. Unfortunately some of the suggestions didn't work but thanks you for you suggestions and tried some stuff out. I created two tables with two different quarries. There are some small downsides to the way i have done it but i am sure i will work it out later on.
See code below for a better understanding.
<html><head><meta http-equiv="refresh" content="30"><link rel="stylesheet" type="text/css" href="./CSS/studentview.css"><script>function scroll(speed) { $('html, body').animate({ scrollTop: $(document).height() - $(window).height() }, speed, function() { $(this).animate({ scrollTop: 0 }, speed); });}speed = 80000;scroll(speed)setInterval(function(){scroll(speed)}, speed * 2);</script></head></body><h1 style="color:white;">Student Device Repair Progress<h1><?php//Create a connection to the serverINCLUDE ("connect.php");//Pull Data$sql = "SELECT TOP 50 PERCENT FirstName, LastName, PercentCompleted FROM RepairTable ORDER BY PercentCompleted DESC";$stmt = sqlsrv_query( $conn, $sql );if( $stmt === false) { die( print_r( sqlsrv_errors(), true) );}echo "<table style='float:left'>";echo "<thead>";echo "<tr><th>First Name</th><th>Last Name</th><th>Status</th></tr>";echo "</thead>";echo "<tbody>";while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) { echo "<tr><td>"; echo $row['FirstName']; echo "</td><td>"; echo $row['LastName']; echo '</td><td id="outer">'; echo '<div class="inner" style="width:'.$row['PercentCompleted'].'%;">'; echo $row['PercentCompleted'];echo "%"; echo "</div>"; echo "</td></tr>";}echo "</tbody>";echo "</table>";//Pull Data$sql = "SELECT TOP 50 PERCENT FirstName, LastName, PercentCompleted FROM RepairTable ORDER BY PercentCompleted ASC";$stmt = sqlsrv_query( $conn, $sql );if( $stmt === false) { die( print_r( sqlsrv_errors(), true) );}echo "<table style='float:right'>";echo "<thead>";echo "<tr><th>First Name</th><th>Last Name</th><th>Status</th></tr>";echo "</thead>";echo "<tbody>";while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) { echo "<tr><td>"; echo $row['FirstName']; echo "</td><td>"; echo $row['LastName']; echo '</td><td id="outer">'; echo '<div class="inner" style="width:'.$row['PercentCompleted'].'%;">'; echo $row['PercentCompleted'];echo "%"; echo "</div>"; echo "</td></tr>";}echo "</tbody>";echo "</table>";//Free Up Resourcessqlsrv_free_stmt( $stmt);// Close the connection.sqlsrv_close( $conn );?><div class="footer" style="color:white;"><ul><li>25% Booked In.</li><li>50% Diagnostic In Progress / Logged With External Repair.</li><li>75% Finalising / External Repair</li><li>100% Completed and Ready to Collect</li><div><p style="font-size:12px;">Web Interface Created and Designed </br>by Andrew Bassett - 2015</p></body></html>

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now