Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap table width size and colspan

table width doesn't work when i use colspan. i need colspan. and width size like 100px; or 10% without colspan bottom source code width size works. how do i edit? may i ask? help please.

<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>
like image 805
user3662974 Avatar asked Jul 21 '26 13:07

user3662974


1 Answers

<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>

I have changed it now, notice that i have taken away the table layout:fixed tag and it worked

like image 102
Brendon Vdm Avatar answered Jul 25 '26 00:07

Brendon Vdm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!