Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.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 css代码,用于水平或在一行中显示多个表_Html_Css - Fatal编程技术网

html css代码,用于水平或在一行中显示多个表

html css代码,用于水平或在一行中显示多个表,html,css,Html,Css,我创建了一个从数据库循环的表。现在我需要在一行中显示这个多表。当前循环以列的形式显示表请有人建议如何编写标记,以便在一行中生成和显示表数据? 例如,如果数据库中有10个表循环,那么一个表行中应该有10个单元格。该表不应包含该行下方的任何内容。如果表格长度超过屏幕宽度,则可以显示水平滚动条 <table width="100%" class="table table-bordered table-striped"> <table> <thead

我创建了一个从数据库循环的表。现在我需要在一行中显示这个多表。当前循环以列的形式显示表请有人建议如何编写标记,以便在一行中生成和显示表数据?

例如,如果数据库中有10个表循环,那么一个表行中应该有10个单元格。该表不应包含该行下方的任何内容。如果表格长度超过屏幕宽度,则可以显示水平滚动条

<table width="100%" class="table table-bordered table-striped">
    <table>
        <thead>
        <tr>
            <th colspan="2">First Name</th>     


        </tr>
        </thead>
        <tbody>
        <tr>
            <td colspan="2">James</td>  

        </tr>
        <tr>
          <td>The</td>
          <td>Tick</td>              
        </tr>


        </tbody>
    </table>

名字
詹姆斯
这个
打上钩

表内的表无效。您必须添加表行,然后添加每个表列下的所有表,如下所示

  <table width="100%" class="table table-bordered table-striped">
     <tr>
       <td>
         <table>
            <thead>
               <tr>
                  <th colspan="2">First Name</th>   
               </tr>
            </thead>
            <tbody>
               <tr>
                  <td colspan="2">James</td> 
               </tr>
               <tr>
                  <td>The</td>
                  <td>Tick</td>              
               </tr>
            </tbody>
        </table>
      </td>
      <td>
         Your Second Table Goes here..
      </td> 
      <td>
         Your Third Table Goes here and so on.
      </td>  
     </tr>
   </table>

名字
詹姆斯
这个
打上钩
你的第二张桌子在这里。。
你的第三张桌子放在这里,以此类推。

如果我理解正确,您希望将上面显示的表格重复多次,并在一行中并排显示

我要做的是将CSS属性
display:inline table
(使用类)添加到相关的表中

请参见以下示例:

.tablePanel{
宽度:300%;
断字:nowrap;
边框:1px点蓝色;
}
.桌板{
边框:1px灰色虚线;
显示:内联表;
宽度:200px;
}

名字
詹姆斯
这个
打上钩
名字
詹姆斯
这个
打上钩
名字
詹姆斯
这个
打上钩
名字
詹姆斯
这个
打上钩

到目前为止您尝试了什么?
标记创建行,如果您只需要一行,只需使用其中一行即可<代码>将
移动到正在使用的任何循环之外。