<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1039502" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1039502</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/formatting-within-tables-php#comment-1223920</link>
    <description> &lt;p&gt;you can echo  ,  and  in PHP&lt;/p&gt;
&lt;p&gt;so then for each image echo the table data&lt;br /&gt;
obviously echoing the end of the TD at the end of each image and text &lt;/p&gt;
&lt;p&gt;because you have this code...&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;while($row = mysql_fetch_array($result))&lt;br /&gt;{&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
I imagine there may be a lot of images, and you want a new line eventually, or they will start to mess up and squash up on the page&lt;br /&gt;
so you will want more than one row, so eventually you will have to echo the end TR  and start a new one&lt;br /&gt;
which you will have to determine yourself&lt;br /&gt;
a count of some sort. so after a certain number of images has been displayed it starts a new row&lt;/p&gt;
&lt;p&gt;so something like this:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;$row_count&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$con &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_connect&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;localhost&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;username&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;password&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;if (!&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$con&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&lt;br /&gt;{&lt;br /&gt;die(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Could not connect: &#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;. &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_error&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_select_db&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;username_product&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$con&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_query&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;SELECT * FROM details ORDER BY id DESC&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;lt;table width=&quot;700&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;while(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_fetch_array&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;))&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row_count&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) { echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;lt;tr&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; } &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// if $row_count is 0 start a table row&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row_count&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;++; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// adds 1 to $row_count&lt;br /&gt;&lt;br /&gt;/*echo nl2br(&quot;Item no: &quot; . $row [&#039;id&#039;]) . &quot;&amp;lt;br&amp;gt;&quot;; */&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;lt;td&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;name&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;lt;br /&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// notice the start of the table data for the image&amp;lt;td&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;lt;img src=&quot;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;image&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&quot; width=&quot;100&quot; height=&quot;100&quot;&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Description: &#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;description&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Price: &#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;price&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;paypal&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;date&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;lt;/td&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;br /&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row_count&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;lt;/tr&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row_count&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;}&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//if the amount of loops is 6, we want to end the row, and making the var 0 will make it start a new one in the IF at the begining of this loop&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&lt;br /&gt;&lt;br /&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row_count &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;&amp;lt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;lt;/tr&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;}&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// if the $row_count is less than 6 when the loop ends, it will not have ended the row as per the last IF in the loop. this will make sure it is done if required&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_close&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$con&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;so it draws a TR, then a TD, then echoes all your details inc an image, then echoes end of TD. loops for the next image with a new TD&lt;/p&gt;
&lt;p&gt;IF it has looped 6 times, it also echoes end of TR and also in the same IF sets the variable back to 0&lt;br /&gt;
so when it starts the loop again for next image it will draw another TR with the IF var ==0, which it does&lt;/p&gt;
&lt;p&gt;notice how after each item is displayed it echoes two line breaks&lt;br /&gt;
so it can then freely draw the next item. you may only one one..play with it&lt;/p&gt;
&lt;p&gt;I&#039;m not too sure if wrapping the whole thing, including an image, in the &#039;scope&#039; is viable&lt;br /&gt;
I am still learning myself, maybe someone else can confrim this&lt;br /&gt;
as so, i removed the&lt;br /&gt;
put it back if you know it&#039;s ok. you get the general idea from the code above&lt;br /&gt;
you can of course wrap the whole thing in a  with a CSS class, or other means of defining the text colour/type/size etc in the output&lt;br /&gt;
echo &#039;&#039;;&lt;/p&gt;
&lt;p&gt;and have the CSS class called &#039;image_text&#039; also align text in the center&lt;/p&gt;
&lt;p&gt;hope that helps&lt;/p&gt;
 </description>
     <pubDate>Thu, 06 Sep 2007 03:08:41 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1223920 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/formatting-within-tables-php#comment-1223875</link>
    <description> &lt;p&gt;Ah, thanks guys, I&#039;ll try your suggestions.&lt;br /&gt;
Sadly, Steve&#039;s suggestion didn&#039;t work. Webwiz, when I use your idea, I seem to have all the products grouped in a line horizontally.&lt;br /&gt;
Thanks anyway guys, I&#039;m trying to find a freelancer who can whip me up a good CMS to save me this trouble &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/sad.png&quot; title=&quot;Sad&quot; alt=&quot;Sad&quot; class=&quot;smiley-content&quot; /&gt;&lt;br /&gt;
Thanks you guys.&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Sep 2007 21:28:07 +0000</pubDate>
 <dc:creator>Shaun</dc:creator>
 <guid isPermaLink="false">comment 1223875 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/formatting-within-tables-php#comment-1223756</link>
    <description> &lt;p&gt;Another idea - abandon the table and just float each image. The images will then wrap automatically to the next line when you run out of space. No need for table cells, line breaks, or much generated HTML at all.&lt;/p&gt;
 </description>
     <pubDate>Sun, 02 Sep 2007 19:18:34 +0000</pubDate>
 <dc:creator>webwiz</dc:creator>
 <guid isPermaLink="false">comment 1223756 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/formatting-within-tables-php#comment-1223755</link>
    <description> &lt;p&gt;Hi Shaun,&lt;/p&gt;
&lt;p&gt;This is just thought; why not try making the table&#039;s width a little smaller, something like 650px or 690px,&lt;br /&gt;
as each product image is 100px making the overall table thinner should force the 7th, 14th... product onto the next line.&lt;/p&gt;
&lt;p&gt;Regards, Steve&lt;/p&gt;
 </description>
     <pubDate>Sun, 02 Sep 2007 18:38:13 +0000</pubDate>
 <dc:creator>Smp Business Hosting</dc:creator>
 <guid isPermaLink="false">comment 1223755 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
