我可以在完整的PHP页面上使用bootstrap吗? [英] Can I use bootstrap on a full PHP page

查看:78
本文介绍了我可以在完整的PHP页面上使用bootstrap吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在我已经必须做出响应的页面上使用bootstrap。该表在PHP中是代码:

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>





我的尝试:



我想知道是否需要在表格的每一行/列周围制作php标签。我只是想知道使这种响应的最佳方法是什么。



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.

推荐答案

result = mysql_query(SELECT * FROM players)

或死亡(mysql_error());



//在表格中显示数据




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

echo< tr>< th> ID< / th>< th>管理控制台< / th>< th>产品版本< / th>< th>平台< / th>< th>数据库< / th>< th>所有者< / th>< th>状态< / th>< th>< / th>< th>< / th>< / TR>中;



//循环数据库查询结果,将它们显示在表

while(
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(
row = mysql_fetch_array(


result)){



//将每行的内容回显到表$ b中
$ b echo< tr>;

echo'< th data-sort-initial =Descending>'。
result )) { // echo out the contents of each row into a table echo "<tr>"; echo '<th data-sort-initial="Descending">' .


这篇关于我可以在完整的PHP页面上使用bootstrap吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆