2017-01-22 194 views
0

截圖:表不適合尺寸屏幕寬度

Screenshot of table

我試圖與UIWebView用於iOS的項目顯示HTML,但你可以從上面的圖像看到,TD不適合於屏幕的寬度。我使用瀏覽器試用了HTML源代碼,並且運行良好,但在移動設備上卻沒有。

我需要什麼使桌子與屏幕完全吻合?

<!DOCTYPE html> 
<html> 
    <head> 
     <meta charset="utf-8"> 
     <title></title> 
     <style> 
      body { 
       font: 9pt tahoma, sans-serif; 
       direction:rtl; 
      } 
      * 
      { 
       margin: 0px; 
       padding: 0px; 
      } 
      html, body 
      { 
       height: 100%; 
      } 
      #print-header { 
       width:95%; 
       margin:10px auto 10px auto; 
       /* 
       background-image:url('../../icon/logo.png'); 
       background-repeat:no-repeat; 
       background-position:left top; 
       */ 
      } 
      #print-header table { 
       border-collapse: collapse; 
       border:0; 
       margin:10px auto 10px auto; 
       text-align: center; 
       width:100%; 
       /*border:1px solid black;*/ 
      } 
      #print-header .key { 
       text-align: left; 
      } 
      #print-header .value { 
       text-align: right; 
       /*font-weight:bold;*/ 
      } 
      #print-header th { 
       border:0; 
       text-align: right; 
       width:50%; 
       /*background:red;*/ 
      } 
      #print-header td { 
       border:0; 
      } 
      #print-body table{ 
       border-collapse: collapse; 
       border:1px solid black; 
       margin:20px auto 20px auto; 
       text-align: center; 
       width:200%; 
       white-space: nowrap; 

      } 
      #print-body thead { 
       font-weight:bold; 
      } 
      #print-body th{ 
       border:1px solid black; 
       padding:2px; 
      } 
      #print-body td{ 
       border:1px solid black; 
       padding:2px; 
      } 
      #print-footer { 
       text-align: center; 
       font-size:13px 
      } 
      #print-body #print-caption { 
       text-align: center; 
       font-weight: bold; 
       font-size: small; 
       padding: 40px 0 30px 0; 
      } 
     </style> 
    </head> 
    <body> 
     <div > 
      <table> 
       <tr> 
        <th rowspan="2" align=right><img border="0" src=".../img.png"></th> 
       </tr> 
      </table> 
     </div> 
     <div id="print-body"> 
      <hr size="4px" style="background-color:black"> 
      <table cellspacing="0" cellpadding="0"> 
       <tr> 
        <td width="100%">ISSUE DATE</td> 
       </tr> 
      </table> 
     </div> 
     <hr size="4px" style="background-color:black"> 
     <div id="print-footer"> 
      <p>sassas<br>asassasa</p> 
     </div> 
    </body> 
</html> 
+0

不熟悉的UIWebView,我沒有任何的iOS設備在這裏,bvut我看到你沒有一個'<元視口「命令。 –

+0

@MrLister嘗試過,但仍然無法正常工作。 – SimpleojbC

回答

0

嘗試表witdh:100%和立場:固定

+0

仍然無法正常工作 – SimpleojbC