2017-06-17 15 views
-1

は、私はこれは動的なページですの変更すべてのページ要素の位置

<?php 

    include("../../config.php"); 

?> 
<!DOCTYPE html> 
<html> 
    <head> 
     <style> 
      .invoice-info { 
      } 

      .table { 
      } 

      table, th { 
       -webkit-print-color-adjust: exact; 
      } 

      table, th, td { 
       border: 1px solid black; 
      } 

      @media print { 
       @page { 
        margin: 20px; 
       } 
      } 

      body { 
       margin: 5.6cm; 
      } 

      .invoice { 
       border-style: solid; 
       border-width: 50px; 
       border-color: #FFFFFF; 
       height: 100%; 
       width: 80%; 
       overflow: visible; 
      } 

      .footer { 
       float: none; 
      } 

      .left-footer { 
       float: left; 
       padding-left: 100px; 
       padding-top: 200px; 
       text-align: center; 
       font-weight: 700; 
       font-size: 18px; 
      } 

      .right-footer { 
       float: right; 
       padding-top: 200px; 
       margin-right: -50px; 
       text-align: center; 
       font-weight: 700; 
       font-size: 18px; 
      } 

      .note-footer { 
       float: inherit; 
       padding-top: 20%; 
       width: 100%; 
      } 
     </style> 
     <meta charset="utf-8"> 
     <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
     <title>Student Result Card</title> 
     <!-- Tell the browser to be responsive to screen width --> 
     <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> 
     <!-- Bootstrap 3.3.6 --> 
     <link rel="stylesheet" href="../../bootstrap/css/bootstrap.min.css"> 
     <!-- Font Awesome --> 
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css"> 
     <!-- Ionicons --> 

    </head> 
    <body class="hold-transition skin-blue sidebar-mini"> 
     <div class="wrapper"> 

      <!-- Logo --> 
      <?php include("header.php"); 
      ?> 

      some text 

      <div class="pad margin no-print"> 
       <div class="callout callout-info" style="margin-bottom: 0!important; text-align:center;"> 
        <h2><?php echo $depname; ?></h2> 
       </div> 
      </div> 
      <div class="mypage"> 
       <!-- Main content --> 
       <section class="invoice"> 
        <?php 
         $query1 = mysqli_query($con,"SELECT student.Result1,student.StudentName,student.DepartmentID,model.ModelID,model.modelname,model.modelcode,grades.StudentID from grades INNER JOIN student ON grades.StudentID = student.StudentID INNER JOIN model ON grades.ModelID = model.ModelID Where DepartmentID='".$dep."' GROUP BY StudentID"); 
         while($row = mysqli_fetch_array($query1)) 
         { 
        ?> 
        <!-- title row --> 
        <div class="row"> 

         <!-- /.col --> 
        </div> 
        <!-- info row --> 
        <div class="row invoice-info"> 
         <div class="col-sm-4 invoice-col"> 
          <address> 
           <strong> 
            some text 
           </strong> 
          </address> 
         </div> 
         <!-- /.col --> 
         <div class="col-sm-4 invoice-col"> 
          <some text 
         </div> 
         <!-- /.col --> 
         <div class="col-sm-4 invoice-col"> 

          <img src="logo.png" style="padding-top:-10px; 
      width:230px;height:150px"> 
         </div> 
         <!-- /.col --> 
        </div> 
        <!-- /.row --> 
        <!-- Table row --> 
        <div class="row" style="margin-top:50px;"> 
         <div class="col-xs-12 table-responsive"> 

          <table class="table table-bordered"> 
           <thead> 
            <tr> 
             <th width="250px">Student Name</th> 
             <th style="text-align: center"> 
              <?php echo $row["StudentName"]; ?> 
             </th> 
            </tr> 
           </thead> 
          </table> 

          <table class="table table-striped"> 
           <tr> 
            <th style="background-color: #80aaff !important;color:white 
        !important;text-align: center;">#</th> 
            <th style="background-color: #80aaff !important;color:white 
         !important;;text-align: center;">Subject Name</th> 
            <th style="background-color: #80aaff !important; 
     color: white !important;text-align: center;">Grade</th> 

           </tr> 
           <tbody> 
            <?php 
             $order=0; 
             $query2 = mysqli_query($con,"SELECT student.Result1,grades.Total1_After_Curve,grades.Total1,grades.ModelID,model.modelname,model.modelcode from grades INNER JOIN student ON grades.StudentID = student.StudentID INNER JOIN model ON grades.ModelID = model.ModelID Where DepartmentName='".$depname."' group by modelid"); 
             while($row2 = mysqli_fetch_array($query2)) 
             { 
              $order++; 

            ?> 
            <tr> 
             <td style="text-align: center;"><?php echo $order; ?></td> 
             <td style="text-align: center;"> 
              <?php echo $row2["modelname"]; ?> 
             </td> 

             <?php 

              if($row2["Total1"] >= 50) 
              { 
               echo ' 
               <td style="text-align: center;">Pass</td>'; 
              } 
              else 
              { 
               echo ' 
               <td style="text-align: center;">Fail</td>'; 
              } 
             ?> 

            </tr> 

            <?php } ?> 

           </tbody> 
           <tfooter> 
            <?php 
            if($row["Result1"] == "0") 
            { 


            echo ' 

            <td style="text-align:center;" colspan="2"> 
             <h4> 
              <strong>RESULT</strong> 
             </h4> 
            </td> 
            <td style="text-align:center;"> 
             <h4><strong>Fail</strong></h4> 
            </td> 

            '; 
            } 
            else 
            { 
            echo ' 

            <td style="text-align:center;" colspan="2"> 
             <h4> 
              <strong>RESULT</strong> 
             </h4> 
            </td> 
            <td style="text-align:center;"> 
             <h4><strong>Pass</strong></h4> 
            </td> 

            '; 
            }?> 

           </tfooter> 
          </table> 
         </div> 
         <!-- /.col --> 
        </div> 
        <!-- /.row --> 

        <div class="row"> 
         <!-- accepted payments column --> 
         <!-- /.col --> 
         <div class="col-xs-12"> 


          <div class="table-responsive"> 
           <div style="float:right; margin-top:-90px; padding-right:100px;"> 

            <div class="left-footer"> 
             <?php echo $_SESSION['login_admin']; ?><br> 
             some text 
            </div> 
            <div class="right-footer"> 
             some text 
            </div> 
            <div class="note-footer"> 
             <h3>Note</h3> 
             <strong>some text</strong> 
            </div> 


           </div> 
          </div> 
          <!-- /.col --> 
         </div> 

         <div class="row no-print"> 
          <div class="col-xs-12"> 

           <a href="Report3-print.html" target="_blank" type="button" class="btn 
      btn-success pull-right"> 
            <i class="fa fa-credit-card"></i> Print 
           </a> 
           <button type="button" class="btn btn-primary pull-right" 
             style="margin-right: 5px;"> 
            <i class="fa fa-download"></i> Generate PDF 
           </button> 
          </div> 
         </div> 
         <?php 

         } ?> 
       </section> 
       <!-- /.content --> 
       <div class="clearfix"></div> 
      </div> 
      <!-- /.content-wrapper --> 


      <div class="control-sidebar-bg"></div> 
     </div> 
    </body> 
</html> 

このページを持っています。最初のページから5,6、...などに行くと、すべての要素が位置を変更しました。私は、出力

Please Click To See First Output

Please Click To See Second Output

をアップロード添付ファイルで

注:私は単にあなたがヘッダ を繰り返したい場合は何であるCTRL + P

答えて

0

をuaingこのページを印刷THEAD要素はのためです。公式文書here

+0

しかし、テーブルの位置が変更されました....私は固定するために何を使用するのですか?私は "位置:固定" CSSの属性を使用するが、私はこれでpaddingまたは余白のようないくつかの他のCSSのフォーマットを使用することはできません – Jack

+0

私はth& – Jack

関連する問題