twitter-bootstrap - Bootstrap 表宽度大小和 colspan

标签 twitter-bootstrap

当我使用 colspan 时,表格宽度不起作用。 我需要科尔斯潘。宽度尺寸如 100px;或 10% 没有 colspan 底部源代码宽度大小有效。 我该如何编辑?我可以问吗? 请帮忙。

<link href="css/bootstrap.min.css" rel="stylesheet">
<style>
  table {
table-layout: fixed;
word-wrap: break-word;
width: 30%;
 }
</style>
</head>
<body>
<table>
  <tr>
      <td colspan="2">abc</td>
 </tr>
  <tr class="table table-bordered">
      <td style="width: 10%;" /td>1</td>
      <td style="width: 20%;" /td>2</td>
  </tr>
</table>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script     src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
 </body>
</html>

最佳答案

<html>
<head>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <style>
      table {
            width: 100%;
            border:1px solid;
     }

     td{
        border:1px solid;
     }
    </style>
    </head>
<body>
<table>
  <tr>
      <td colspan="2">abc</td>
 </tr>
  <tr >
      <td style="width: 40%;">1</td>
      <td style="width: 60%;">2</td>
  </tr>
</table>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script     src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
 </body>
</html>

我现在已经更改了它,请注意我已经删除了 table layout:fixed 标签并且它起作用了

关于twitter-bootstrap - Bootstrap 表宽度大小和 colspan,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30595190/

相关文章:

html - 表格内表格或表格内表格,哪个适合有效的 Twitter Bootstrap 标记?

jquery - Twitter bootstrap 显示来自另一个模态的模态

html - 如何将侧边栏扩展到页面的整个高度?

javascript - jquery、jquery-ui 和 bootstrap 的 CSS 和 Javascript 顺序

html - 如何在 twitter bootstrap 中调整宽度?

javascript - 如何使一行内的所有图像大小相等?

css - Twitter bootstrap 选项卡的内容正在混合

javascript - 如何在 Bootstrap 模式中动态调整字体大小?

javascript - 菜单链接在手机/平板电脑中不起作用

javascript - Bootstrap slider 更改最大值