...

View Full Version : New to tables question



Heeter
02-20-2008, 10:17 PM
Hi all,

I am trying tp put 2 contact information side by side, but they always end one on top of each other. I think the way I am putting my tags is wrong. Can't seem to figure it out, though.

Here is the code that I am working with:


<tr>
<td align="left" valign="top"><table width="100%" cellpadding="0" cellspacing="0" id="">
<tr>
<br><br><td align="left"><span class="rightheader"><b><font size="4">Edmonton<br>
West End<br>
(780)455-8157<br>
FAX(780)451-9334<br>
<a href="mailto:cded@camerondriver.com">cded@camerondriver.com</a><br>
15879 - 116 Avenue<br>
T5M 3W1<br>
Out of Town Toll Free<br>
1-800-661-7031<br></font></b>
</span>
</tr>
</td>
</tr>

<tr>
<td align="left" valign="top"><table width="100%" cellpadding="0" cellspacing="0" id="">
<tr>
<br><br><td align="left"><span class="rightheader"><b><font size="4">Red Deer<br>
(403)341-4711<br>
FAX (403)341-4716<br>
<a href="mailto:rdcd@camerondriver.com">rdcd@camerondriver.com</a><br>
Bay 8 - 7439 — 49 Avenue Cr.<br>
T4P 1X6<br>
Out of Town Toll Free<br>
1-888-343-4711<br><br>
<br>
<br>
</span>
</tr>
</td>
</tr>


Here is what it looks like right now

http://www.camerondriver.com/contact.php


Thanks in advance,

Heeter

jcdevelopment
02-20-2008, 10:23 PM
well you are putting them in seperate <tr>, those are the rows, try this



<table>
<tr>
<td align="left" valign="top"><table width="100&#37;" cellpadding="0" cellspacing="0" id=""></td>
<td align="left" valign="top"><table width="100%" cellpadding="0" cellspacing="0" id=""></td>
</tr>
<tr>
<br><br><td align="left"><span class="rightheader"><b><font size="4">Edmonton<br>
West End<br>
(780)455-8157<br>
FAX(780)451-9334<br>
<a href="mailto:cded@camerondriver.com">cded@camerondriver.com</a><br>
15879 - 116 Avenue<br>
T5M 3W1<br>
Out of Town Toll Free<br>
1-800-661-7031<br></font></b>
</span>
</td>
<td><br><br><td align="left"><span class="rightheader"><b><font size="4">Red Deer<br>
(403)341-4711<br>
FAX (403)341-4716<br>
<a href="mailto:rdcd@camerondriver.com">rdcd@camerondriver.com</a><br>
Bay 8 - 7439 — 49 Avenue Cr.<br>
T4P 1X6<br>
Out of Town Toll Free<br>
1-888-343-4711<br><br>
<br>
<br>
</span>
</td>
</tr>

</table>


see if that works better for you

sobrien79
02-20-2008, 10:30 PM
If you are just learning tables, then you should know that using tables as a method of laying out content that isn't data related is bad. :)

Try this instead:

Styles:


address {
float: left;
font-size: 12pt;
font-style: normal;
margin-right: 20px;
}


Code:


<address>
Edmonton<br />
West End<br />
(780)455-8157<br />
FAX(780)451-9334<br />
<a href="mailto:cded@camerondriver.com">cded@camerondriver.com</a><br />
15879 - 116 Avenue<br />
T5M 3W1<br />
Out of Town Toll Free<br />
1-800-661-7031
</address>

<address>
Red Deer<br />
(403)341-4711<br />
FAX (403)341-4716<br />
<a href="mailto:rdcd@camerondriver.com">rdcd@camerondriver.com</a><br />
Bay 8 - 7439 — 49 Avenue Cr.<br />
T4P 1X6<br />
Out of Town Toll Free<br />
1-888-343-4711
</address>


Result: Cleaner code and semantic meaning behind the tags and the data.

Heeter
02-20-2008, 10:40 PM
Awesome, much, much nicer!!!

I am still trying to get it to put each other side by side, instead of one contact on top of the other.

Should I put in a second entry into the css then?

Thanks,

UPDATE:::: Now I see what you mean.

It is still a little wonky for me but I can see where this is going.

Thanks again.

sobrien79
02-20-2008, 10:46 PM
the float: left css declaration puts the 2 items next to one another. The address in the css will match all address elements in the html. Not just the first so there is no need to add more to the css than what I provided.

Either what I or jcdevelopment suggested should work though.

Heeter
02-20-2008, 10:53 PM
Thanks you guys,

It looks really good, like I want it now.

Thanks to both of you.

Heeter



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum