Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 把桌子放在桌子上_Html_Css_Html Table - Fatal编程技术网

Html 把桌子放在桌子上

Html 把桌子放在桌子上,html,css,html-table,Html,Css,Html Table,<div id="container"> <div class="main_div"> <div class="cell1">1</div> <div class="cell2">2</div> <table> <tr> <td > The Tag </td> <td> The Tag </td

<div id="container">

<div class="main_div">

  <div class="cell1">1</div>
  <div class="cell2">2</div>

    <table>
     <tr>

       <td > The Tag </td>
        <td> The  Tag </td>
             .....
          more data
      </tr>

     </table>
</div>
</div>

</body>
</html>
/*我应该如何将容器缩小到桌子宽度*/还是没有解决方案?
我的容器有左右两侧的间隙&当我把桌子放进去时,它看起来很奇怪,不适合容器盒?

嗯?如果你想把桌子放进容器里,为什么要把桌子弄得比容器大

<div id="container">

<div class="main_div">

  <div class="cell1">1</div>
  <div class="cell2">2</div>

    <table>
     <tr>

       <td > The Tag </td>
        <td> The  Tag </td>
             .....
          more data
      </tr>

     </table>
</div>
</div>

</body>
</html>
尝试:

<div id="container">

<div class="main_div">

  <div class="cell1">1</div>
  <div class="cell2">2</div>

    <table>
     <tr>

       <td > The Tag </td>
        <td> The  Tag </td>
             .....
          more data
      </tr>

     </table>
</div>
</div>

</body>
</html>

如果这不是你的意思,你需要更清楚地回答你的问题,因为我真的不理解你的思考过程。

你不能让900像素的桌子放在640像素的容器中。最好在其中一个中声明宽度,并让另一个使用该宽度:

<div id="container">

<div class="main_div">

  <div class="cell1">1</div>
  <div class="cell2">2</div>

    <table>
     <tr>

       <td > The Tag </td>
        <td> The  Tag </td>
             .....
          more data
      </tr>

     </table>
</div>
</div>

</body>
</html>
#container { width: 900px; }
table { width: 100%; }

我补充了我的怀疑