How to use with a while
How to use with a while
Tiruve
Posts: 4Questions: 1Answers: 0
Hi everyone,
I want to use DataTables with a table that is in a while which take informations from my database.
So, when I try to use DataTables, It only find one entry, and I see all my entries, but I can't search, or click on one of my tbody to sort out.
Please help me ^^
(Sorry for my bad english, I'm french ahah)
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Post sample code please.
Bonjour,
If you could link to the page you are having problems with please we'll take a look and see what is going wrong. Unfortunately we really can't offer any help without a full description of the problem and being able to debug it.
Allan
Hello,
Sorry for the delay,
so, I work on a test table, which is on my testing website, but I can't give you the link because it's protected by a htaccess with password.
There is my code :
Invalid HTML. Your opening
<tbody>
tag should be outside your loop.Also, you require a
<thead></thead>
.Oh, thank's, it work perfectly!
I'm so bad...
Move the
echo '<tbody>';
out of the while loop. At the moment your code is creating invalid HTMl.Allan
There's a funny echo in here....
Haha - sorry. I completely missed your reply! I tend to open a mass of tabs with questions to reply to and work my way through them - I must have had it open while you were fixing it :-)
Allan
Thank you both!