Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Need help with this table
Old 06-07-2007, 03:15 PM Need help with this table
Noobstein's Avatar
Super Talker

Posts: 102
Name: Kyle Shwartz
Trades: 0
The image in the first row throws off the rest off the alignment of my other cells. I cant fit multiple td cells on a row that's directly below the image. They always go past the borders of the image even though i only have a little bit of text. I can get the first cell to go underneith, but the second cell is always far off to the right.


I've been playing with it for a while now and finally realized that I need help.




Code:
<body bgcolor="#ffffff">
<table bgcolor="#cccccc" cellspacing="10" style="border: solid 3px black;">
  <tr>
    <td style="padding-bottom:5px; background-color:#cccccc;"> <img src="../../web images/header.png" /></td>
  </tr>
  <tr align="left">
    <th><td align="left" height="100" width="100" style="background:#ffffff;">Auf Wierdshen</td>
     <td height="100" width="100" style="background:#ffffff;">Auf Wierdshen</td></th>
  </tr>
</table>
</body>
Noobstein is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-07-2007, 03:31 PM Re: Need help with this table
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
It's this line that's jacked:
HTML Code:
<th><td align="left" height="100" width="100" style="background:#ffffff;">Auf Wierdshen</td>
     <td height="100" width="100" style="background:#ffffff;">Auf Wierdshen</td></th>
Your first <th> begins populating the first cell, then you do a <td> which moves on to the next cell (which is to the right of your image) and begins breaking your HTML.

I'd suggest changing to

HTML Code:
<th align="left" height="100" width="100" style="background:#ffffff;">Auf Wierdshen</th>
     <th height="100" width="100" style="background:#ffffff;">Auf Wierdshen</th>
or
HTML Code:
<td align="left" height="100" width="100" style="background:#ffffff;">Auf Wierdshen</td>
     <td height="100" width="100" style="background:#ffffff;">Auf Wierdshen</td>
depending on if you want those as a header. Either way,you'll want to adjust your image to span both rows now, so your code would then be like
HTML Code:
<body bgcolor="#ffffff">
<table bgcolor="#cccccc" cellspacing="10" style="border: solid 3px black;">
  <tr>
    <td style="padding-bottom:5px; background-color:#cccccc;"> <img src="../../web images/header.png" colspan="2"/></td>
  </tr>
  <tr align="left">
    <th align="left" height="100" width="100" style="background:#ffffff;">Auf Wierdshen</th>
     <th height="100" width="100" style="background:#ffffff;">Auf Wierdshen</th>
  </tr>
</table>
</body>
Note, that you should not be using a table for layout. Tables are for marking up data, not layout.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 06-07-2007, 03:52 PM Re: Need help with this table
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
HTML Code:
<body bgcolor="#ffffff">
  <table bgcolor="#cccccc" cellspacing="10" style="border: solid 3px black;">
    <tr>
      <td style="padding-bottom:5px; background-color:#cccccc;" colspan="3">
        <img src="../../web images/header.png" alt="" />
      </td>
    </tr>
    <tr align="left">
      <th>this is a column header</th>
      <td align="left" height="100" width="100" style="background:#ffffff;">Auf Wierdshen</td>
      <td height="100" width="100" style="background:#ffffff;">Auf Wierdshen</td>
    </tr>
  </table>
</body>
A th tag is a column header, ans is treated the same way as a <td> by a browser.
You don't wrap it around td's.

Your cells where shifted because the unique cell in the first line growed to take the size of the picture.
As there was no colspan, the browser respected the order of the columns.
The rowspan allows you to specify to the browser how much column a given cell must span over.

As I keeped the <th>, it makes 3 columns, thus the colspan="3" in the first cell attributes.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 06-07-2007, 03:53 PM Re: Need help with this table
Noobstein's Avatar
Super Talker

Posts: 102
Name: Kyle Shwartz
Trades: 0
I'm only using tables because its going to be a craigslist advertisment and I can't use divs.

It didn't work.

Code:
<body bgcolor="#ffffff">
<table bgcolor="#cccccc" cellspacing="10" style="border: solid 3px black;">
  <tr>
    <td style="padding-bottom:5px; background-color:#cccccc;"> <img src="../../web images/header.png" colspan="2"/></td>
  </tr>
  <tr align="left">
    <th align="left" height="100" width="100" style="background:#ffffff;">Auf Wierdshen</th>
     <th height="100" width="100" style="background:#ffffff;">Auf Wierdshen</th>
  </tr>
</table>
</body>
Noobstein is offline
Reply With Quote
View Public Profile
 
Old 06-07-2007, 03:56 PM Re: Need help with this table
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Oh, I made a typo and put the colspan on the image instead of the TD. This will correct that:

HTML Code:
<body bgcolor="#ffffff">
<table bgcolor="#cccccc" cellspacing="10" style="border: solid 3px black;">
  <tr>
    <td style="padding-bottom:5px; background-color:#cccccc;" colspan="2"> <img src="../../web images/header.png" /></td>
  </tr>
  <tr align="left">
    <th align="left" height="100" width="100" style="background:#ffffff;">Auf Wierdshen</th>
     <th height="100" width="100" style="background:#ffffff;">Auf Wierdshen</th>
  </tr>
</table>
</body>
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 06-07-2007, 03:57 PM Re: Need help with this table
Noobstein's Avatar
Super Talker

Posts: 102
Name: Kyle Shwartz
Trades: 0
^^Got it. Col=3 had to go into the first td like you were saying. Big thanks guys. I'll re-read what u guys were telling me so I understand it a little better.
Noobstein is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Need help with this table
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.58313 seconds with 12 queries