{"id":7357028,"date":"2016-05-07T05:33:47","date_gmt":"2016-05-07T05:33:47","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/table-search-and-pagination-with-colspan\/"},"modified":"2016-08-31T17:21:29","modified_gmt":"2016-08-31T17:21:29","slug":"table-search-and-pagination-with-colspan","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/table-search-and-pagination-with-colspan\/","title":{"rendered":"Table search and pagination with colspan"},"content":{"rendered":"<p>I understand that you are supposedly unable to use the search and pagination and colspan at the same time and that functionality is controlled by DataTables. Their site has an <a href=\"https:\/\/datatables.net\/examples\/advanced_init\/complex_header.html\">example<\/a> that uses all three functions at the same time. Is there a way to get that working properly <a href=\"http:\/\/clarkcounty.info\/political-candidate-evaluation-matrix-test\/\">here<\/a>? <\/p>\n<p>Right now I can only get the colspan columns to line up if I insert this code show below in the custom commands field for the table, but if I do this the search function disappears:<br \/>\n&#8216;var table =jQuery(&#8216;#bwki_sites_display&#8217;).DataTable( {     &#8216;pageLength&#8217;: 10,     &#8216;lengthMenu&#8217;: [ 10, 20, 50, 100, 200 ],     &#8216;order&#8217;: [[ 0, &#8216;desc&#8217; ]],      } ); table.rows().every( function () {     var row = table.row( $(this));     html = &#8216;&lt;i class=&#8221;fa fa-plus&#8221;&gt;&lt;\/i&gt;Colspan will come here&#8217;;                   row.child(html).show();     $(this).addClass(&#8216;shown&#8217;);                                               });&#8217;<\/p>\n<p>As the table is coded now, and I put something in the search box the &#8216;previous&#8217; and &#8216;next&#8217; pagination shows up, but this does not show up on initial page load.<\/p>\n<p>Any suggestions to getting all of these working at the same time?<\/p>\n<p>https:\/\/wordpress.org\/plugins\/tablepress\/<\/p>\n","protected":false},"template":"","class_list":["post-7357028","topic","type-topic","status-publish","hentry","topic-tag-colspan","topic-tag-pagination"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/7357028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/7357028\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=7357028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}