From f69195b22d5011bc7598dee9f0ea5f5ed74c3af9 Mon Sep 17 00:00:00 2001
From: Prasath Nadarajah <n.prasath.002@gmail.com>
Date: Fri, 3 Aug 2012 02:32:17 -0700
Subject: [PATCH] displaying options in dynamic tables

---
 .../push-syndication-server.php               | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/push-syndication-server/push-syndication-server.php b/push-syndication-server/push-syndication-server.php
index ae9b978..592102f 100644
--- a/push-syndication-server/push-syndication-server.php
+++ b/push-syndication-server/push-syndication-server.php
@@ -413,20 +413,20 @@ class Push_Syndication_Server {
 		$selected_siteoptions = !empty( $selected_siteoptions ) ? $selected_siteoptions : array() ;
 
 		$site_options = wp_load_alloptions();
-		$chunked_arrays = array_chunk( $site_options, 5, true );
 
 		echo '<table border="1">';
 		echo '<tbody>';
 
-		foreach( $chunked_arrays as $chunked_array ) {
+		$i = 0;
 
-			echo '<tr>';
-
-			foreach( $chunked_array as $key => $value ) {
+		foreach( $site_options as $key => $value ) {
 
 			if( $key[0] == '_' )
 				continue;
 
+			if ( $i == 5 )
+				echo '<tr>';
+
 ?>
 				<td>
 					<label>
@@ -436,13 +436,16 @@ class Push_Syndication_Server {
 				</td>
 <?php
 
-			}
+			$i++;
 
-			echo '</tr>';
+			if ( $i == 5 ) {
+				echo '<tr>';
+				$i = 0;
+			}
 
 		}
 
-		echo '</tbody';
+		echo '</tbody>';
 		echo '</table>';
 
 	}
-- 
GitLab