Jump to content

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>

I need to create two table that splits information that has been pulled down from a SQL server with descending order at the top. These tables can not duplicate the information. 
Reason behind this is to limit the requirement to scroll page. 
Please see attached photo of concept idea

Note: Image has been blurred to hide names and Business Identification.

 

Thanks,

-Fallen Soul

post-222005-0-50979800-1433552078_thumb.

Link to comment
https://linustechtips.com/topic/381199-double-table-in-html/
Share on other sites

Link to post
Share on other sites

@Nuluvius i am not sure what you mean.

I think he is referring to the way tables used to be used to layout the website which was then replaced with divs.

 

tables are looked down apon for there use to change the layout of a page.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
https://linustechtips.com/topic/381199-double-table-in-html/#findComment-5152804
Share on other sites

Link to post
Share on other sites

@Nuluvius i am not sure what you mean.

 

I think he is referring to the way tables used to be used to layout the website which was then replaced with divs.

 

tables are looked down apon for there use to change the layout of a page.

 

Well yes there is that but one has only to consult Google for a much better summary of the information available on the subject.

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
https://linustechtips.com/topic/381199-double-table-in-html/#findComment-5153624
Share on other sites

Link to post
Share on other sites

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>
Link to comment
https://linustechtips.com/topic/381199-double-table-in-html/#findComment-5156700
Share on other sites

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×