Click here to Skip to main content
15,921,028 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, I am looking to use bootstrap on a page I already have to make to responsive. The table is in PHP here is the code:
<html>

<head>
    <link rel="stylesheet" type="text/css" href="style.css"> 
    
    <link href='bootstrap.css' rel='stylesheet'>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    <script src='bootstrap.js'></script>

<title>View Records</title>

</head>

<body>
    
    <div class="container">
    
    <center><a href="https://repo-project-danielmurran.c9users.io/view.php"><img src="logo.png" alt="what image shows" height="90" width="300"></a></center>
    
    <h1>GCS Reproduction Environment</h1></br>
    
    <hr/>

    <h2>All Reproductions</h2>
    

    


<?php

/*

VIEW.PHP

Displays all data from 'players' table

*/



// connect to the database

include('connect-db.php');



// get results from database

$result = mysql_query("SELECT * FROM players")

or die(mysql_error());



// display data in table




echo "<table border='1' cellpadding='10' class='sortable'>";

echo "<tr> <th>ID</th> <th>Administration Console</th> <th>Product Version</th> <th>Platform</th> <th>Database</th> <th>Owner</th> <th>Status</th> <th></th> <th></th></tr>";



// loop through results of database query, displaying them in the table

while($row = mysql_fetch_array( $result )) {



// echo out the contents of each row into a table

echo "<tr>";

echo '<th data-sort-initial="Descending">' . $row['id'] . '</th>';


echo '<td data-sort-initial="Descending"><a href="'.$row['curl'].'">'.$row['curl'].'</a></td>';

echo '<td data-sort-initial="Descending">' . $row['pversion'] . '</td>';

echo '<td data-sort-initial="Descending">' . $row['platform'] . '</td>';

echo '<td data-sort-initial="Descending">' . $row['dversion'] . '</td>';

echo '<td data-sort-initial="Descending"><a href="mailto:'.$row['email'].'">' . $row['email'].'</a></td>';

echo '<td data-sort-initial="Descending">' . $row['status'] . '</td>';

echo '<td data-sort-initial="Descending"><a href="edit.php?id=' . $row['id'] . '">Edit</a></td>';

echo '<td data-sort-initial="Descending"><a href="delete.php?id=' . $row['id'] . '">Delete</a></td>';

echo "</tr>";

}



// close table>

echo "</table>";

?>

<p><a href="new.php">Add a new record</a></p>


</div>
</body>

</html>


What I have tried:

I wonder if I need to make php tags around each row/column in the table. Im just wondering what the best way to make this responsive is.
Posted
Updated 15-Mar-17 23:36pm

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900