create pagination table from html
create pagination table from html
jessica
Posts: 4Questions: 1Answers: 0
Hi everyone,
I am creating the html to create the table structure and would like to spend settings iTotalRecords and iTotalDisplayRecords the html.
Is there any way to do this?
$(document).ready( function () {
var table = $('#example').DataTable();
} );
Name |
---|
Jessica |
Rute |
This discussion has been closed.
Answers
Not quite sure what "spend settings" means exactly
I would like to implement paging through html
Still not sure what that means.
If you mean you just want to have DataTables initiate on a table thats using the DOM as the source (eg: through html), then you dont really have to do anything other than initiate the DataTable on that table... As long as it has enough rows to start the paging (10 by default), then you will see the pagination on the bottom.
Heres an example of a DataTable initiated on a table thats purely HTML, and as you can see, with no settings, the pagination is at the bottom.
Are you trying to implement custom settings for
paging
to override the defaults?Just look into the
paging
,lengthMenu
,lengthChange
andpageLength
settingsthen I ride a table html eg with 10 lines, but this table has 100 rows, as I step into the plugin that this table has 100 line and not 10, to automatically generate the correct paging html
You are going to have to give us a link to the page you are working with - I don't actually understand what you are looking for I'm afraid.
DataTables will automatically create the required paging from a DOM sourced table. The
iTotalRecords
andiTotalDisplayRecords
parameters are for legacy server-side processing and have nothing to do with a DOM sourced table.Allan
good Morning,
sAjaxSource am using to generate my table.
I would like to pass the parameters of the form
That isn't doing anything. You aren't assigning the result to anything. This legacy example might be of some use, but I would encourage you to consider using the modern method with
ajax
.Allan