Bootstrap 4 table disable paging?
Bootstrap 4 table disable paging?
sunny_s
Posts: 31Questions: 2Answers: 0
Hi, I am using Bootstrap 4 styling, I like to keep the ordering feature and the search feature, but would like to know is there any way to have a full table of data instead of paging?
I tried this function but doesn't work
$('#cus-table').DataTable({
"paging": false,
"info": false
});
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The
pageLength
option set to -1 should do what you are asking. Here is an example:http://live.datatables.net/mimovudo/1/edit
You may also want to use
"paging": false,
.Kevin
Hey Kevin,
"paging": false does remove the paging, but the "Showing 1 to 1 of 1 entries" isn't updating?
And is there any way to move the search bar from right to left?
I'm guessing you are adding data to the table after Datatables initializes?
If so how are you adding the data?
The
dom
option is used to control the placement of the Datatables features. There is an example with Bootstrap integration. I haven't tried myself so don't know the exact config with Bootstrap.Kevin
Hi Keivn,
Right now it's hard code. I added one more
tbody
in the html file. It wasAnd then it was
Later on all data will come from backend instead of hard code.
The js file is an external js file, I have
Oh, so I realize I shouldn't add
tbody
aftertbody
, but anothertr
. I made that change and theShowing 1 to 1 of 1 entries
updatesJust to confirm - its all working as expected now?
Hi, Allan,
Yes, thank you for helping.