www.webdeveloper.com
Results 1 to 5 of 5

Thread: HTML Tables not aligning right 0_o

  1. #1
    Join Date
    Mar 2010
    Posts
    20

    Question HTML Tables not aligning right 0_o

    It seems like I've been doing this forever but these tables for some reason aren't aligning



    Anyone tell me why even after 3 re-types it still won't work? I guess messing with CSS and javascript for so long have messed with my mind :P



    <table width=350><tr width=350><td width=100&#37;><center><font color=FFFFFF>Online Scoreboard</font></center></td></tr><tr width=350><td width=50%><center><font color=FFFFFF>BIG RED</font></center></td><td width=50%><center><font color=FFFFFF>Central</font></center></td></tr></table>


    So why is the 2nd row screwing up? I mean, 50%+50%=100%, am I not right? So why is the first one extending past the 50%? Heck, it's goign to 100%I think...
    Last edited by ChromeLover; 05-30-2010 at 02:56 PM.

  2. #2
    Join Date
    Mar 2010
    Posts
    2,803
    1) why have you got a width of 100% in the 1st row td. If you want it to span over the 2 cells in row 2 then use colspan.

    2) you don't need to specify a row width since you specified a table width.

    3) you are using deprecated code (<font> and <center>). You should be using css styles to format the table and its contents.

    Matybe have a read of the w3schools tutorial on creating html tables.

  3. #3
    Join Date
    Sep 2008
    Location
    Connecticut
    Posts
    123
    Code:
    <table width="350">
      <tr>
      <td><center><font color="#FFFFFF">Online Scoreboard</font></center></td>
      </tr>
      <tr>
      <td width="50&#37;"><center><font color="#FFFFFF">BIG RED</font></center></td>
      <td width="50%"><center><font color="#FFFFFF">Central</font></center></td>
      </tr>
    </table>
    and follow Tirna's essential suggestions as well. These deprecated tags should be avoided at all costs.

  4. #4
    Join Date
    Mar 2010
    Posts
    20
    Ahhh, it just hit me that that does make sense.... Thanks so much guys!


    Well the site is going to be for personal use, spades scoreboard inplace when we can't use our REAL one, and it needs to run on the Iphone, and I don't have one to test so I don't want to use CSS as I am not sure how greatly it supports it, even though it is supposed to run a good ol' webkit browser....Thanks so much guys! I can't believe how I didn't try removing those <tr>'s.....grr......Well Its 2AM, No time to re-write it now I'll re-type the code and tell you guys how you did ^_^

  5. #5
    Join Date
    Sep 2008
    Location
    Connecticut
    Posts
    123
    Try this out to test how your design will look on iPhone: http://iphonetester.com/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles