响应表不使用bootstrap

时间:2017-01-28 16:52:55

标签: php twitter-bootstrap

我正在使用bootstrap.i构建php网站使用类.table-responsive来制作一个响应表但是在这个特定的页面中它根本没有响应。我在另一个页面中使用此代码并且像魅力一样工作< / p>

这是我的代码

<?php
include ('lheader.php');
require ('conntodb.php');

session_start();
$recs= $conn->prepare('SELECT st_id, name, address, telephone, nop, noi  

FROM magazia WHERE user_id = :user_id');
$recs->bindParam(':user_id', $_SESSION['user_id']);
$recs->execute();
$res= $recs->fetch(PDO::FETCH_ASSOC);
$_SESSION['st_id'] = $res['st_id'];
$_SESSION['name'] = $res['name'];
$_SESSION['address'] = $res['address'];
$_SESSION['telephone'] = $res['telephone'];
$_SESSION['nop'] = $res['nop'];
$_SESSION['noi'] = $res['noi'];


if (isset($_POST['submitted'])) {
if($_SESSION['noi'] < 3){
$noi=$_SESSION['noi'];
$noi++;
$errors = array();

$imgFile = $_FILES['st_im']['name'];
$tmp_dir = $_FILES['st_im']['tmp_name'];
$imgSize = $_FILES['st_im']['size'];
if (empty($_FILES['st_im'])) {
$errors[] = 'you forgot the picture!';
}else{

$upload_dir = 'users_uploads/'; // upload directory

$imgExt = strtolower(pathinfo($imgFile,PATHINFO_EXTENSION)); // get image extension

// valid image extensions
 $valid_extensions = array('jpeg', 'jpg', 'png', 'gif'); // valid extensions

     // rename uploading image
     $st_im = rand(1000,1000000).".".$imgExt;
 }
     if(in_array($imgExt, $valid_extensions)){
 // Check file size '5MB'
if($imgSize < 5000000)    {
move_uploaded_file($tmp_dir,$upload_dir.$st_im);
}
else{
$errors[] = "Sorry, your file is too large.";
}
}
else{
$errors[] = "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
}
if (empty($errors)){
 $conn->beginTransaction();

 try{
$stmt1=$conn->prepare("INSERT INTO images (st_id, image) VALUES  (:st_id,:st_im)");
 $stmt1->bindParam(':st_id', $st_id, PDO::PARAM_INT);
 $stmt1->bindParam(':st_im', $st_im, PDO::PARAM_STR);
 $st_im= $st_im;
 $st_id=$_SESSION['st_id'];
  $stmt1 ->execute();

  $stmt=$conn->prepare("UPDATE magazia SET noi= :noi WHERE st_id= :st_id");
  $stmt->bindParam(':st_id', $_SESSION['st_id'], PDO::PARAM_INT);
  $stmt->bindParam(':noi', $noi, PDO::PARAM_INT);
  $stmt->execute();
 $conn->commit();

  echo "New records created successfully";
 }catch(Exception $e){
 //An exception has occured, which means that one of our database queries
  //failed.
  //Print out the error message.
  echo $e->getMessage();
  //Rollback the transaction.
   $conn->rollBack();
    }
     }
    else { // Report the errors.

   echo '<h1>Σφάλμα</h1>
   <p class="error">Παρουσιάστηκαν τα παρακάτω σφάλματα:<br />';
    foreach ($errors as $msg) { // Print each error.
       echo " - $msg<br />\n";
    }
     echo '</p><p>Παρακαλώ ξαναπροσπαθήστε!</p><p><br /></p>';

     }
  }else {
echo "Μπορείτε να ανεβάσετε μεχρι 3 φωτογραφίες";
  }
 }
 ?>
 <div class="mainbody">

 <h4>Καλώς Ήρθατε <?php echo $_SESSION['fullname'];?></h4>
 <div class="container">
  <h4>Στοιχεία</h4>
 <div class="table-responsive">
  <table class="table">
    <thead>
      <tr>

 <th>Ονοματεπώνυμο</th>
                <th>Όνομα</th>
                <th>Διεύθυνση</th>
                <th>Τηλέφωνο</th>


      </tr>
    </thead>
    <tbody>
      <tr>
        <td><?php echo $_SESSION['fullname'];?></td>
        <td><?php echo $_SESSION['name'];?></td>
        <td><?php echo $_SESSION['address'];?></td>
        <td><?php echo $_SESSION['telephone'];?></td>

      </tr>
    </tbody>
  </table>
  </div>
</div>

我还尝试了

中指定的@media规则

http://getbootstrap.com/2.3.2/scaffolding.html#responsive

但无效

我错过了什么?

提前感谢!

1 个答案:

答案 0 :(得分:1)

你没有遗漏任何东西 只是你和Twitter Bootstrap对 响应 有不同的定义。

应用CALL FUNCTION 'WS_DELIVERY_UPDATE_2' EXPORTING vbkok_wa = wa_vbkok " Header Data synchron = 'X' commit = 'X' delivery = vbeln " delivery number update_picking = 'X' if_database_update_1 = '1' TABLES vbpok_tab = it_vbpok[] " Item Data prot = it_return. " Message Return Table CLEAR: deliv_head,wa_vbkok. READ TABLE it_return INTO wa_return WITH KEY msgty = 'E'. IF sy-subrc <> 0. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = 'X'. ELSE. * message handling ENDIF. 后,表格将在小型设备上水平滚动(如果您没有更改响应性断点,则在768px以下)。

在大于768像素宽的任何东西上观看时,没有区别。

请参阅文档和示例here