Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery plugin Datatable :using rowspan in tbody causes wrong

I am using one jQuery plug-in called DataTables:

http://www.datatables.net/

The plugin doesn't support rowspan in tbody

<tr class="colorrow">   
    <td id="greater" rowspan="3">TMMS</td> 
    <td>Case Volume</td> 
    <td>0</td> 
    <td>0</td> 
    <td>0</td> 
    <td>1</td> 
    <td>1</td>
</tr>

Is there any other solution for this?

like image 543
crafet Avatar asked Aug 07 '11 07:08

crafet


2 Answers

Try this. Just apply css "display:none;" where you want to apply rowspan.

<table id="example">
<tr class="colorrow">   
    <td id="greater" rowspan="3">TMMS</td> 
    <td>Case Volume</td> 
    <td>0</td> 
    <td>0</td> 
    <td>0</td> 
    <td>1</td> 
    <td>1</td>
</tr>
<tr class="colorrow">   
    <td style="display: none;">TMMS</td> 
    <td>Case Volume</td> 
    <td>0</td> 
    <td>0</td> 
    <td>0</td> 
    <td>1</td> 
    <td>1</td>
</tr>
<tr class="colorrow">   
    <td style="display: none;">TMMS</td> 
    <td>Case Volume</td> 
    <td>0</td> 
    <td>0</td> 
    <td>0</td> 
    <td>1</td> 
    <td>1</td>
</tr>
</table>

Put same script for datatable.

<script type="text/javascript">
      $(document).ready(function() {
            $('#example').DataTable();
      });
</script>
like image 170
disha Avatar answered Oct 21 '22 00:10

disha


http://datatables.net/plug-ins/api#fnFakeRowspan

like image 32
Anton Lyhin Avatar answered Oct 20 '22 22:10

Anton Lyhin