how can I do if i click the thead tag the tfoot will go between thead and tbody tag, if i click it again the thead tag, the tfoot tag will go back under the tbody tag like in the sample in image
By default when clicking the thead table is sorted by that column. You can turn this off or let it happen its up to you. Your click event should work either way.
It looks like you're new here. If you want to get involved, click one of these buttons!
DataTables designed and created by SpryMedia Ltd.
SpryMedia Ltd is registered in Scotland, company no. SC456502.