Connecting Tech Pros Worldwide Forums | Help | Site Map

Help with Table design

Member
 
Join Date: Oct 2008
Location: Cleveland Ohio
Posts: 67
#1: Nov 18 '08
Hello,

I have a table on my account page that allows users to view their account name and account balance. When they sign up, I am not sure how many accounts they have so I allow them to enter up to 5. However, when the table shows up in the account page, it has extra space if the user has anything less than 5 accounts. I also allow the user to enter a "other" account if they don't find their account on the drop down during registration. Is there any trick to eliminate this akward spacing? I have listed my table coding below. Thanks for any tips

Expand|Select|Wrap|Line Numbers
  1. <table width="30%" border="0" cellpadding="5" cellspacing="0"> 
  2. <tr><table border="2" cellpadding="5" cellspacing="3" bordercolor="black" bgcolor="black">
  3. <tr bgcolor="black">
  4. <tr bgcolor="silver">
  5. <th>Account</th>
  6. <th>Balance</th></tr>
  7. <tr valign="top" bgcolor="white">
  8. <td><%=objRS("account1")%></td>
  9. <td><%=objRS("balance1")%></td></tr>
  10. <tr valign="top" bgcolor="white">
  11. <td><%=objRS("otheraccount1")%></td>
  12. <td><%=objRS("balance1")%></td></tr>
  13. <tr valign="top" bgcolor="white">
  14. <td><%=objRS("account2")%></td>
  15. <td><%=objRS("balance2")%></td></tr>
  16. <tr valign="top" bgcolor="white">
  17. <td><%=objRS("otheraccount2")%></td>
  18. <td><%=objRS("balance2")%></td></tr>
  19. <tr valign="top" bgcolor="white">
  20. <td><%=objRS("account3")%></td>
  21. <td><%=objRS("balance3")%></td></tr>
  22. <tr valign="top" bgcolor="white">
  23. <td><%=objRS("otheraccount3")%></td>
  24. <td><%=objRS("balance3")%></td></tr>
  25. <tr valign="top" bgcolor="white">
  26. <td><%=objRS("account4")%></td>
  27. <td><%=objRS("balance4")%></td></tr>
  28. <tr valign="top" bgcolor="white">
  29. <td><%=objRS("otheraccount4")%></td>
  30. <td><%=objRS("balance4")%></td></tr>
  31. <tr valign="top" bgcolor="white">
  32. <td><%=objRS("account5")%></td>
  33. <td><%=objRS("balance5")%></td></tr>
  34. <tr valign="top" bgcolor="white">
  35. <td><%=objRS("otheraccount5")%></td>
  36. <td><%=objRS("balance5")%></td></tr>
  37. </table></td>

Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#2: Nov 18 '08

re: Help with Table design


You could create the table using your server side scripting language. Generally the script first finds out much data it needs to display so it generates a table best suited for that data only.
Reply


Similar HTML / CSS bytes