...

View Full Version : table side by side



ajetrumpet
01-03-2010, 11:43 PM
all,

is it possible to put two tables side by side? I'm trying to do this, with one 70% wide, and the other 25% wide. but in the code with dreamweaver, it automatically places them vertically on the page. can i fix this?

gusblake
01-04-2010, 12:20 AM
If you are using tables for layout anyway you might as well have each table inside a cell in a container table, but it would be easier with divs and float:left.

using tables:


<html>
<head>
<title></title>
</head>
<table width="100%">
<tr>
<td>
<table width="70%">
<tr>
<td>
col 1
</td>
</tr>
</table>
</td>

<td>
<table width="25%">
<tr>
<td>
col 2
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>


using divs:


<html>
<head>
<title></title>
</head>
<body>
<div style="float:left;width:70%">
col 1
</div>

<div style="float:left;width:25%">
col 2
</div>
</body>
</html>

Excavator
01-04-2010, 01:26 AM
Hello ajetrumpet,
Yes, like gusblake says, divs would be easier.
Not sure what your building but did you know that tables are not for layout (http://webdesign.about.com/od/layout/a/aa111102a.htm)?

Have a look at a basic 2 column layout using divs here (http://nopeople.com/CSS/equal_length_columns/index.html).

Hope that helps...

ajetrumpet
01-04-2010, 01:48 AM
Hello ajetrumpet,
Yes, like gusblake says, divs would be easier.
Not sure what your building but did you know that tables are not for layout (http://webdesign.about.com/od/layout/a/aa111102a.htm)?

Have a look at a basic 2 column layout using divs here (http://nopeople.com/CSS/equal_length_columns/index.html).

Hope that helps...

I know that tables are not for layout, but I am not an HTML expert, and it takes a heck of a lot less time to get it right and compatible with mail servers this way in any other way. And I don't know that much about divs. I don't even know what they're for really, but I think it stands for "divider". :)

Everyone says that tables are bad for layout, but I don't know of any other way to make good use of my time. I don't really understand what gusblake posted, but I'm trying to figure it out.

And so you know, I'm trying to send a formatted newsletter. I got it done, but it took 2 hours, so there's gotta be an easier way to do this. I'm using a mass mailing software to send this, so I need the HTML code to paste into it. I'm formatting it in Dreamweaver. Got any other suggestions?

Sorry for the ignorance!

abduraooft
01-04-2010, 09:02 AM
And so you know, I'm trying to send a formatted newsletter. I got it done, but it took 2 hours, so there's gotta be an easier way to do this. I'm using a mass mailing software to send this, so I need the HTML code to paste into it. I'm formatting it in Dreamweaver. Got any other suggestions? For newsletter? Then tables might be the best for the time being! Take a look at http://articles.sitepoint.com/article/designers-guide-html-email.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum