mrclark219 Posted August 21, 2009 Share Posted August 21, 2009 Hello all, I am fairly new to the php world and I created a table from my mysql database, but the table is extremely large. I need a way to make this table collapsible. Sort of like a show/hide type feature. Is this possible? Any help would be greatly appreciated!! This is the code I used to pull the data from the database, not sure if that will help at all but its worth the try! $xmlDoc->addTable($stock->addRelation('purchaseOrders')->getData(array('purchaseOrders.dbPurchaseOrderNumber', 'purchaseOrderParts.dbVendorNumber', 'purchaseOrders.dbPurchaseDate', 'purchaseOrders.dbReceived', 'purchaseOrderParts.dbQuantity'), NO_PRIMARY_KEY,'purchaseOrderParts.dbPartNumber="' . $partNumber . '" ORDER BY purchaseOrders.dbPurchaseDate DESC LIMIT 100'), CONTENT_NODE, array('TABLE'=>array('SHOW_HEADER'=>'1', 'LABEL'=>'Purchase Orders'))); if(!$stock->addRelation('purchaseOrders')->numRows) $xmlDoc->addData('No results found', $dataTag); $xmlDoc->addTag('HR', $hrTag); Thanks, Thomas Clark Quote Link to comment https://forums.phpfreaks.com/topic/171304-collapsible-table-help-please/ Share on other sites More sharing options...
ignace Posted August 21, 2009 Share Posted August 21, 2009 Well I can think of a few ways. 1. Use LIMIT $offset, $count in your query. This way you will only see $count number of rows starting from $offset. 2. Use JavaScript each x number of row add an empty row that has a collapse button in it when clicked it shows/hides all rows that has it's prefix. Use element.style.display = 'block' to show and element.style.display = 'none' to hide. An example of what I mean can be found here: http://framework.zend.com/about/faq Quote Link to comment https://forums.phpfreaks.com/topic/171304-collapsible-table-help-please/#findComment-903422 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.