Hi,
thanks for your post, and sorry for the trouble.
I’m not really sure if I understand. You will probably just have to print that new line by printing the HTML <br />
tag.
Regards,
Tobias
Dear Tobias,
By using <br>
I come up with a single line. So to get back to my example. I will have :
User A :
line 1 (header) Cars
line 2 (body) mercedes
dacia
renault
I am loosing “sort” functionnality for e.g. as I have all my data in the same line.
I am looking for this result :
User A :
line 1 (header) Cars
line 2 (body) mercedes
line 3 (body) dacia
line 4 (body) renault
I hope it is clear 🙂
Ben
Hi Ben,
ah, ok. So you want to create real table rows here.
To be honest, I don’t really see the point of using TablePress here then. Instead, just use your PHP code to render the full HTML table.
You can then simply use the DataTables JS library for the sorting directly (that’s the library that TablePress uses). See http://next.datatables.net/ for information on that.
Regards,
Tobias
Dear Tobias,
You are right and it worked for me but there is something I do not understand. Maybe you have an easy answer to that…
Tablepress plugins is installed on my wordpress but if I want to use function of DataTables, I have to load all the libraries. Is it not strange ?
I have tried a lot of diferent ways (header, enqueue etc.) and the only way I found out is to write this at the begining of my wordpress page:
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.0-rc.1/css/jquery.dataTables.css"><script type="text/javascript" charset="utf8" src="//code.jquery.com/jquery-1.10.2.min.js"></script><script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.0-rc.1/js/jquery.dataTables.js"></script>
Maybe you can advice me on this.
Also TableTools is not showing…
<script>
$(document).ready( function () {
$('#sommets').DataTable({
"sDom": 'T<"clear">lfrtip'
} );
} );
</script>
Thank you for your help 🙂
Hi,
you don’t really have to load all the libraries from an external source, you can also include the ones that TablePress ships with.
Using a custom wp_enqueue_script
call should be the best here, for independence from TablePress.
Regards,
Tobias