Javascript 在最小化屏幕时,桌子应该缩小

Javascript 在最小化屏幕时,桌子应该缩小,javascript,jquery,html,css,responsive-design,Javascript,Jquery,Html,Css,Responsive Design,我有一张像这样的桌子 <form id="form1"> <table style="width:75%;font-size:15px;" align="center" id="info" > ... </table> </form> ... 缩小浏览器时,我希望相应地调整表格。我试着保持这个姿势:相对的。但还是不行。有线索吗 您必须直接给出表格的宽度 1. 2. 3. 4. 您尝试使用的设计称为响应式设计。 有很多库可用于创建响

我有一张像这样的桌子

<form id="form1">
    <table style="width:75%;font-size:15px;" align="center" id="info" >
...
</table>
</form>

...

缩小浏览器时,我希望相应地调整表格。我试着保持这个姿势:相对的。但还是不行。有线索吗

您必须直接给出表格的宽度


1.
2.
3.
4.

您尝试使用的设计称为响应式设计。 有很多库可用于创建响应性网页设计。而下面提到的可能是使网页跨各种设备响应性的不同方法,例如桌面、平板电脑、移动设备

1) jquerymobile-

2) 引导Css和Js-


用于媒体查询cssUse各种库(如Bootstrap和Jquery mobile)提供的响应性设计。不起作用。最小化浏览器后,屏幕仍然不适合屏幕内部。请使用Daenarys提到的库提供响应支持,
http://code.jquery.com/mobile/git/jquery.mobile-git.js
http://code.jquery.com/mobile/git/jquery.mobile-git.css
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h2>Basic Table</h2>
  <p>The .table class adds basic styling (light padding and only horizontal dividers) to a table:</p>            
  <table class="table">
    <thead>
      <tr>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>Email</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>John</td>
        <td>Doe</td>
        <td>john@example.com</td>
      </tr>
      <tr>
        <td>Mary</td>
        <td>Moe</td>
        <td>mary@example.com</td>
      </tr>
      <tr>
        <td>July</td>
        <td>Dooley</td>
        <td>july@example.com</td>
      </tr>
    </tbody>
  </table>
</div>

</body>
</html>
 /* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}

@media only screen and (max-width: 768px) {
    /* For mobile phones: */
    [class*="col-"] {
        width: 100%;
    }
}