Html Colspan 不能在引导表上工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14831742/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 05:33:49  来源:igfitidea点击:

Colspan not working on bootstrap table

htmltwitter-bootstrap

提问by Jacques Bronkhorst

I have a nested bootstrap tableand I want colspanto work on it, but it does not seem to work.

我有一个嵌套的引导程序table,我想colspan处理它,但它似乎不起作用。

At the end of the day, I would like to end up with something like this:

在一天结束时,我想以这样的方式结束:

   ____________________
  |   Col1 | Col2      |
  |--------------------|
  |This is data I want |
  |--------------------|
  | Col 1  | Col 2     |
  ---------------------- 

I created this fiddleto demonstrate the full functionality.

我创建了这个小提琴来演示完整的功能。

回答by Gericke

I have fixed your fiddle

我已经修好了你的小提琴

 <tr class="child">
     <td colspan="7">
      <table>
         <tr>
            <td colspan="7">Expand This To Full Table</td>
          </tr>
      </table>
     </td>
</tr>

回答by Angela

As G-Man mentioned, you need to have the outermost tdto do the colspan. The inner table actually does not need any colspanas follows. Although, I don't think it would be a good idea to nest tablewithin a table, but it's really up to you depending on the situation. Fiddle Updated

正如 G-Man 所提到的,你需要最外层td来做colspan. 内表实际上不需要任何colspan如下。虽然,我认为嵌套table在 a 中不是一个好主意table,但这取决于具体情况。小提琴更新

<td colspan="7">Some Content Here</td>