Problem with bootstrap table

0

Good I have a problem of css in a bootstrap table when filled with several characters the column Diagnostic columns are dates are made smaller so they show the cut dates need that the columns with date remain static without shrinking so your date always shows up well , this is the code.

 <table id="userss" class="table table-striped table-bordered table condensed table-hover table-responsive " >
            <thead>

        <th>Id</th>
        <th >Dias</th>
        <th>A/P Fecha</th>
        <th>Fecha Cumple</th>
        <th>Diagnostico/Observaciones</th>
        <th>Medico</th>
        <th>Tipo</th>
        <th>Acciones</th>


            </thead>







     </table>
    
asked by leonaidass 04.08.2017 в 02:24
source

2 answers

2

As far as I can see, you use DataTables. There is a specific option that is columns.width that you can use as follows:

$('#mi-tabla').dataTable( {
  "columnDefs": [
    { "width": "20%", "targets": 0 },
    { "width": "60%", "targets": 1 },
    { "width": "20%", "targets": 2 }
  ]
} );

There you can specify the width of each column.

    
answered by 04.08.2017 / 08:41
source
-1

Applying a width fixed with css can be achieved:

.table th.fixed-width {
    min-width: 80px;
}
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" type="text/css" />


<table id="userss" class="table table-striped table-bordered table condensed table-hover table-responsive " >
       <thead>
        <th>Id</th>
        <th>Dias</th>
        <th class="fixed-width">A/P Fecha</th>
        <th class="fixed-width">Fecha Cumple</th>
        <th>Diagnostico/Observaciones</th>
        <th Medico</th>
        <th>Tipo</th>
        <th>Acciones</th>
      </thead>
  <tbody>
    <td>
      22
    </td>
    <td>
      12
    </td>
    <td>
      12-12-1555
    </td>
    <td>
      12-12-1555
    </td>
    <td>
      adsfasdfasdlfasd;klfj askdljf al;skdjf la;skdjf ;lkasdfj;alksdjf klasdjfl;kasdjf;lak sdjfasjflaskdjf ;slkdjfas;lkdjf
    </td>
    <td></td>
    <td></td>
    <td></td>
    
  </tbody>
     </table>
  
</body>
</html>
    
answered by 04.08.2017 в 04:27