Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 499 Bytes

README.md

File metadata and controls

23 lines (17 loc) · 499 Bytes

pandas-to-datatables

Pandas dataframe to jQuery DataTables

I had some trouble searching for the correct format to export a pandas dataframe to jQuery DataTables.

python code:

table = df.to_json(orient='split', index=False)
return table

DataTables js

$(document).ready(function() {
                    $('#example').DataTable( {
                        'ajax':{url: 'link/to/above', dataSrc: 'data'}
                    } );
                } );

Hopefully this helps someone.