colspan does not work on the Datatable in C #

3

For example, I have a datatable:

<script type="text/javascript" class="init">

$(document).ready(function () {
    $('#table_1').DataTable( );
});

 </script>
<table id="table_1" class="table table-striped table-bordered" >
<thead>

    <tr style="background-color: #ff6a00; color: #fff">
        <th>Dato 1</th>
        <th>Dato 2</th>
        <th>Dato 3</th>
        <th>Dato 4</th>

    </tr>
 </thead>
 <tbody>
     <tr>
       <td></td>
       <td colspan="3"></td>
     </tr>
 </tbody>
 </table>

But when using the colspan, I lose the property of the filter, pagination and searcher of the datatable. I realize that it does not work, or there is something incompatible in its use. I would like to be able to find a solution. Does anyone know how to get to use the colspan in the datatable ???

Currently there is a solution, for example:

 <tr>
  <td colspan="3">Wide column</td>
  <td style="display: none;"></td>
  <td style="display: none;"></td>
</tr>
<tr>
 <td>Normal column</td>
 <td>Normal column</td>
 <td>Normal column</td>
</tr>

But it does not decrease the width of the cell that is hidden. It looks bad, even if I put width = 0. I have left the board aligned to the left with the remaining widths to the right. It does not look good

    
asked by Danilo 26.09.2016 в 05:31
source

2 answers

1

Excellent, I could emulate with css: the solution would be this:

  position:absolute;margin-left: 0; display: inline-block;"

this makes me look good without affecting the width of the cells

    
answered by 26.09.2016 в 22:40
0

There is still no support for databales.

  

Sorry - at the moment Responsive does not work with colspan. This is a   known limitation that I hope to get time to resolve with a future   release.

Source

    
answered by 26.09.2016 в 22:03