HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Tables Within Tables not wrapping
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table
View previous topic :: View next topic  
Author Message
barksn



Joined: 11 Feb 2008
Posts: 1

PostPosted: Mon Feb 11, 2008 3:43 pm     Tables Within Tables not wrapping Reply with quote

I have several tables within another table. What I'm trying to achieve is the table equivalent of word wrapping. What I want to do is wrap the contents of the main table so that if your screen is wider than the site has been designed for, you are able to see more items in a single row in a table.

Why won't tables within tables wrap?
Here's the code i'm playing with:

<html>
<body>
<table style="width:100%; border-collapse: collapse" border="1"><tr><td style="width:100%; word-wrap: break-word; white-space: nowrap">
<table style="width:160; border-collapse: collapse" cellpadding=0 cellspacing=0 border=0 ID="Table1"><tr><td><div align=center><a href="shopexd.asp?id=7150&referrer=customerratings"><img src="/images/promo/DYMATIZE-ELITE-WHEY-5LB.JPG" border="0"></a></div></td></tr><tr><td align=center><div align=center><a href="shopexd.asp?id=7150&referrer=customerratings">Dymatize Elite Whey</a></div></td></tr><tr><td><div align=center><b>Size: </b>2.27kg</div></td></tr><tr><td><div align=center><b>Price: </b><font color=FF0000><b>£29.99</b></font></div></td></tr><tr><td><div align=center><b>Rating: </b><a href="shopexd.asp?id=7150&referrer=customerratings"><img src="/images/4stars.gif" border="0"></div></a></td></tr></table><br>
<table style="width:160; border-collapse: collapse" cellpadding=0 cellspacing=0 border=0 ID="Table2"><tr><td><div align=center><a href="shopexd.asp?id=6676&referrer=customerratings"><img src="/images/promo/instantized-whey-gold.jpg" border="0"></a></div></td></tr><tr><td align=center><div align=center><a href="shopexd.asp?id=6676&referrer=customerratings">Optimum Nutrition 100% Gold Standa&hellip;</a></div></td></tr><tr><td><div align=center><b>Size: </b>2.27kg</div></td></tr><tr><td><div align=center><b>Price: </b><font color=FF0000><b>£34.95</b></font></div></td></tr><tr><td><div align=center><b>Rating: </b><a href="shopexd.asp?id=6676&referrer=customerratings"><img src="/images/4stars.gif" border="0"></div></a></td></tr></table><br>
<table style="width:160; border-collapse: collapse" cellpadding=0 cellspacing=0 border=0 ID="Table3"><tr><td><div align=center><a href="shopexd.asp?id=4503&referrer=customerratings"><img src="/images/promo/bsn-no-explode.jpg" border="0"></a></div></td></tr><tr><td align=center><div align=center><a href="shopexd.asp?id=4503&referrer=customerratings">BSN No Xplode</a></div></td></tr><tr><td><div align=center><b>Size: </b>0.82kg</div></td></tr><tr><td><div align=center><b>Price: </b><font color=FF0000><b>£29.99</b></font></div></td></tr><tr><td><div align=center><b>Rating: </b><a href="shopexd.asp?id=4503&referrer=customerratings"><img src="/images/4stars.gif" border="0"></div></a></td></tr></table><br>
<table style="width:160; border-collapse: collapse" cellpadding=0 cellspacing=0 border=0 ID="Table4"><tr><td><div align=center><a href="shopexd.asp?id=3887&referrer=customerratings"><img src="/images/promo/la-muscle-norateen-heavyweight-ii.jpg" border="0"></a></div></td></tr><tr><td align=center><div align=center><a href="shopexd.asp?id=3887&referrer=customerratings">LA Muscle Norateen Heavywe&hellip;</a></div></td></tr><tr><td><div align=center><b>Size: </b>180 Tabs</div></td></tr><tr><td><div align=center><b>Price: </b><font color=FF0000><b>£48.49</b></font></div></td></tr><tr><td><div align=center><b>Rating: </b><a href="shopexd.asp?id=3887&referrer=customerratings"><img src="/images/2stars.gif" border="0"></div></a></td></tr></table><br>
<table style="width:160; border-collapse: collapse" cellpadding=0 cellspacing=0 border=0 ID="Table5"><tr><td><div align=center><a href="shopexd.asp?id=7807&referrer=customerratings"><img src="/images/promo/flapjack.jpg" border="0"></a></div></td></tr><tr><td align=center><div align=center><a href="shopexd.asp?id=7807&referrer=customerratings">Chemical Nutrition Pro Flapjacks</a></div></td></tr><tr><td><div align=center><b>Size: </b>24 x 75g Flapjack</div></td></tr><tr><td><div align=center><b>Price: </b><font color=FF0000><b>£18.99</b></font></div></td></tr><tr><td><div align=center><b>Rating: </b><a href="shopexd.asp?id=7807&referrer=customerratings"><img src="/images/4stars.gif" border="0"></div></a></td></tr></table><br>
<table style="width:160; border-collapse: collapse" cellpadding=0 cellspacing=0 border=0 ID="Table6"><tr><td><div align=center><a href="shopexd.asp?id=4475&referrer=customerratings"><img src="/images/promo/LA-Muscle-LA-Whey-2.27kg.JPG" border="0"></a></div></td></tr><tr><td align=center><div align=center><a href="shopexd.asp?id=4475&referrer=customerratings">LA Muscle LA Whey</a></div></td></tr><tr><td><div align=center><b>Size: </b>2.27kg</div></td></tr><tr><td><div align=center><b>Price: </b><font color=FF0000><b>£49.99</b></font></div></td></tr><tr><td><div align=center><b>Rating: </b><a href="shopexd.asp?id=4475&referrer=customerratings"><img src="/images/4stars.gif" border="0"></div></a></td></tr></table><br>
</td></tr></table>
</body>
</html>
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8203
Location: Castle Rock CO USA

PostPosted: Mon Feb 11, 2008 3:54 pm     Reply with quote



You will need to float the tables. Something like
Code:
<table style="width:160; border-collapse: collapse; float: left" cellpadding="0" cellspacing="0" border="0" ID="Table1">
Of course you could always something like
Code:
<table style="width: 100%">
   <tr>
      <td>
      <table style="width: 160; border-collapse: collapse;" cellpadding="0" cellspacing="0" border="0" id="Table1">
         <tr>
            <td>
            <div align="center">
               <a href="shopexd.asp?id=7150&amp;referrer=customerratings">
               <img src="/images/promo/DYMATIZE-ELITE-WHEY-5LB.JPG" border="0"></a></div>
            </td>
         </tr>
         <tr>
            <td align="center">
            <div align="center">
               <a href="shopexd.asp?id=7150&amp;referrer=customerratings">Dymatize
               Elite Whey</a></div>
            </td>
         </tr>
         <tr>
            <td>
            <div align="center">
               <b>Size: </b>2.27kg</div>
            </td>
         </tr>
         <tr>
            <td>
            <div align="center">
               <b>Price: </b><font color="FF0000"><b>£29.99</b></font></div>
            </td>
         </tr>
         <tr>
            <td>
               <b>Rating: </b>
               <a href="shopexd.asp?id=7150&amp;referrer=customerratings">
               <img src="/images/4stars.gif" border="0">
            </a></td>
         </tr>
      </table>
      </td>
      <td>
      <table style="width: 160; border-collapse: collapse" cellpadding="0" cellspacing="0" border="0" id="Table2">
         <tr>
            <td>
            <div align="center">
               <a href="shopexd.asp?id=6676&amp;referrer=customerratings">
               <img src="/images/promo/instantized-whey-gold.jpg" border="0"></a></div>
            </td>
         </tr>
         <tr>
            <td align="center">
               <a href="shopexd.asp?id=6676&amp;referrer=customerratings">Optimum
               Nutrition 100% Gold Standa…</a>
            </td>
         </tr>
         <tr>
            <td><b>Size: </b>2.27kg </td>
         </tr>
         <tr>
            <td>
               <b>Price: </b><font color="FF0000"><b>£34.95</b></font>
            </td>
         </tr>
         <tr>
            <td>
            <div align="center">
               <b>Rating: </b>
               <a href="shopexd.asp?id=6676&amp;referrer=customerratings">
               <img src="/images/4stars.gif" border="0"></a></div>
            </td>
         </tr>
      </table>
      </td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
   </tr>
</table>
And keep repeating the tables in the <td>

_________________
Corey
Residential Office Solutions | Mile High Merchant Accounts | Expression Web Blog
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial