3

I have a really big columns, around 40 columns and want to scroll horizontally, but its not working.

$(document).ready(function () {
    $('#example').dataTable({
            "oTableTools": {
                           "sScrollY": 200,
                           "sScrollX": "200%",
                           "sScrollXInner": "110%"
             }
    });
});
madth3
  • 7,275
  • 12
  • 50
  • 74
beebek
  • 1,893
  • 5
  • 29
  • 33

2 Answers2

6

Removing the scroll-x-inner might help.

"sScrollXInner": "110%"

It worked for me. Source datatables.net/forums

mgs
  • 404
  • 4
  • 15
0

the best solution is wrapping the target table with tag by jquery and creating an break line
tag to separate please see below sample code

            $('#target_table').wrap("<div id='tableData' style='\n\
                                        overflow: auto;\n\
                                        overflow-y: hidden;\n\
                                        -ms-overflow-y: hidden\n\
                                        position:relative;\n\
                                        margin-right:5px;\n\
                                        padding-bottom: 15px;\n\
                                        display:block;\n\
                                   '>/");; 

           $("#tableData").before("<br/><br/>");  

the problem is if your using sScrollX or scrollX is that not all datatables plugin version support this function and it depends also in jquery platform that we are using and not all browsers are supported like with the damn IE8,7 and 6.

Hermes
  • 41
  • 3