...

View Full Version : Centre tables side by side on paget



alex98uk
12-29-2009, 01:08 PM
I have some horrible old code which I am re-working, but it seems to be almost there. This is just a small Uni project, so nothing too important. What I want is for the two tables, author tags and article tags to be in the centre of the page, side by side.

At the moment it looks like this when one is aligned left and the other right. But, how do I get both into the middle, one next to the other. Two SS's below show what I have and what I want.

What I has:

http://i70.photobucket.com/albums/i120/alex98uk/th_demo1.jpg (http://s70.photobucket.com/albums/i120/alex98uk/?action=view&current=demo1.jpg)

What I want:

http://i70.photobucket.com/albums/i120/alex98uk/th_demo2.jpg (http://s70.photobucket.com/albums/i120/alex98uk/?action=view&current=demo2.jpg)

This is what I have coded, please excuse the messiness of it, I am re-working old code :(:

In CSS:


table.main {
border-top : 2px solid black ;
border-left : 2px solid black;
border-bottom: 2px solid black;
border-right: 2px solid black;
background: #CCCCCC;
width: 778px;
}

table.main2 {
border-top : 2px solid black ;
border-left : 2px solid black;
border-bottom: 2px solid black;
border-right: 2px solid black;
background: #CCCCCC;
width: 394px;
}

In HTML:


<table class="main" table align="center">
<tr>
<td>

<h2>Test Input</h2>

This would be an article written by an author right here. The stuff below will be some kind of tag like thing.
</table>


<table class="main2" table width="33%" align="left">
<tr>
<td>
<h2>Article Tags</h2>

<p>In order to assign tags, you must be registered and logged in. Logs of who submitted the tag are kept to minimise abuse.</p>
<form action="insert_tag.php" method="post">
<table width="300">
<tr>
<td>Tag #1:</td>
<td><input type="text" name="tag1"/> </td>
</tr>
<tr>
<td>Tag #2:</td>
<td><input type="text" name="tag2" /></td>
</tr>
<tr>
<td>Tag #3:</td>
<td><input type="text" name="tag3"/></td>
</tr>
<tr>
<td>Tag #4:</td>
<td><input type="text" name="tag4"/><br/>
</td>
</tr>
<tr>
<td>Tag #5:</td>
<td><input type="text" name="tag5" /></td>
</tr>

<tr>
<td colspan="2"><?PHP
require_once('recaptchalib.php');
$publickey = "xxx"; // you got this from the signup page
echo recaptcha_get_html($publickey);
?>
</td>
</tr>
</br>
<tr>
<td><input type="Submit" name="Submit" value="Submit" /></td>
</tr>
</form>
</table>
</table>

<table class="main2" align="right" table width="33%">
<tr>
<td>
<h2>Author Tags</h2>

<p>In order to assign an author tags, you must be registered and logged in. Logs of who submitted the tag are kept to minimise abuse.</p>
<form action="insert_tag.php" method="post">
<table width="300">
<tr>
<td>Tag #1:</td>
<td><input type="text" name="tag1"/> </td>
</tr>
<tr>
<td>Tag #2:</td>
<td><input type="text" name="tag2" /></td>
</tr>
<tr>
<td>Tag #3:</td>
<td><input type="text" name="tag3"/></td>
</tr>
<tr>
<td>Tag #4:</td>
<td><input type="text" name="tag4"/><br/>
</td>
</tr>
<tr>
<td>Tag #5:</td>
<td><input type="text" name="tag5" /></td>
</tr>

<tr>
<td colspan="2"><?PHP
require_once('recaptchalib.php');
$publickey = "xxx"; // you got this from the signup page
echo recaptcha_get_html($publickey);
?>
</td>
</tr>
</br>
<tr>
<td><input type="Submit" name="Submit" value="Submit" /></td>
</tr>
</form>
</table>

</td>
</tr>
</table>

abduraooft
12-29-2009, 02:16 PM
Please post a link to your page.

alex98uk
12-29-2009, 02:28 PM
[link removed]

abduraooft
12-29-2009, 03:19 PM
I'd recommend you to modify a CSS based layout given at http://www.bonrouge.com/2c-hf-fixed.php for your needs, as using tables for layout is very bad (http://www.hotdesign.com/seybold/)!

Also, take a look at http://www.alistapart.com/articles/prettyaccessibleforms/, to see how to make an accessible form without using any tables.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum