Old 07-17-2005   #1 (permalink)
Registered User
 
DeathByPixels's Avatar
 
Join Date: Jul 2005
Location: Cornwall, UK
Posts: 8

Send a message via ICQ to DeathByPixels Send a message via AIM to DeathByPixels Send a message via MSN to DeathByPixels Send a message via Yahoo to DeathByPixels Send a message via Skype™ to DeathByPixels
Need help with XHTML tables

I've been trying to code a fairly simple layout for a friend and have run into a problem already.


www.astralplanet.co.uk/test/et/index.htm

Basically, I'm trying to set up a table cell for the main content (white box is meant to be the content area), and I want this in the middle (put it this way, the vertical slogan is on the left, content area in the middle, navigaion on the right). but it keeps going to the right. And the navigation panel won't show up. How do I make the main content area go to the middle and make the navigation panel show up? I've tried this in Firefox and IE6. I'm new to coding, but have been trying to teach myself. but I'm stuck with this.

This is the code I've got so far.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Energetic Training</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>

<table class="pageborders" align="center" width="750" border="0" cellpadding="0" cellspacing="0">
<!-- Header -->
  <tr>
  	<td class="headerbackground" height=92><img src="http://www.astralplanet.co.uk/test/et/images/title.gif" alt="Energetic Training"></td>
  	<td class="headerbackground" height="92">&nbsp;</td>
  </tr>
<!-- END Header -->
  <tr>
  	<td width="35" align="left" valign="top"><img src="http://www.astralplanet.co.uk/test/et/images/slogan.gif" alt="Enjoy the gift of learning..."></td>
<!-- Main Content Area -->
	<td width="579" align="center" class="maincontentarea"> </td>
<!-- END Main Content Area -->
<!-- Navigation -->
	<td width="136" align="right" class="navpanel"> </td>
<!-- END Navigation -->
  </tr>
</table>

</body>
</html>
Would be grateful for any help.

Thanks.
__________________
Talk Digital Design - A web and graphic design tutorial website with forums, gallery, articles, *auction house, *video tutorials and *link directory - currently under development.
Features marked with * will be added at a later date.
DeathByPixels is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-17-2005   #2 (permalink)
get nasty!
 
Uncle Ghed's Avatar
 
Join Date: Jun 2005
Location: Rome, Italy
Posts: 82

Send a message via MSN to Uncle Ghed
Set a colspan in the second cell of your header...
Otherwise you have two cells on the first <tr> and three on second! ^^

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Energetic Training</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>

<table class="pageborders" align="center" width="750" border="0" cellpadding="0" cellspacing="0">
<!-- Header -->
  <tr>
  	<td class="headerbackground" height=92><img src="http://www.astralplanet.co.uk/test/et/images/title.gif" alt="Energetic Training"></td>
  	<td class="headerbackground" height="92" colspan="2">&nbsp;</td>
  </tr>
<!-- END Header -->
  <tr>
  	<td width="35" align="left" valign="top"><img src="http://www.astralplanet.co.uk/test/et/images/slogan.gif" alt="Enjoy the gift of learning..."></td>
<!-- Main Content Area -->
	<td width="579" align="center" class="maincontentarea"> </td>
<!-- END Main Content Area -->
<!-- Navigation -->
	<td width="136" align="right" class="navpanel"> </td>
<!-- END Navigation -->
  </tr>
</table>

</body>
</html>
__________________
some day I'll understand why on earth I started drawing...
Uncle Ghed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-17-2005   #3 (permalink)
Registered User
 
DeathByPixels's Avatar
 
Join Date: Jul 2005
Location: Cornwall, UK
Posts: 8

Send a message via ICQ to DeathByPixels Send a message via AIM to DeathByPixels Send a message via MSN to DeathByPixels Send a message via Yahoo to DeathByPixels Send a message via Skype™ to DeathByPixels
Okay thanks, but exactly what does colspan do (just for my future reference)? Btw, it didn't solve my problem, not that I can see...
__________________
Talk Digital Design - A web and graphic design tutorial website with forums, gallery, articles, *auction house, *video tutorials and *link directory - currently under development.
Features marked with * will be added at a later date.

Last edited by DeathByPixels; 07-17-2005 at 11:43 PM.
DeathByPixels is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-18-2005   #4 (permalink)
code anyone?
 
scrowler's Avatar
 
Join Date: Feb 2004
Location: New Zealand
Posts: 590

Send a message via MSN to scrowler Send a message via Skype™ to scrowler
colspans simply define how many columns the cell should span. colspan="2" would mean the regular cell would span 2 cells horizontally. it's like if you took 2 cells in a table next to eachother and merged them to create one cell with a colspan of 2.

rowspan is the same but vertical.

-edit- the reason your coding isn't working is because the current layout of your table doesn't support 3 columns along while theres only 2 in the top, without doing what its doing. you need to use nested tables, as in, where you have a table inside a table.

try this code:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Energetic Training</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>

<table class="pageborders" align="center" width="750" border="0" cellpadding="0" cellspacing="0">
  <tr>
  	<td class="headerbackground" height="92"><img src="http://www.astralplanet.co.uk/test/et/images/title.gif" alt="Energetic Training"></td>
  </tr>
  <tr>
     <table style="border: 0">
  	<td width="35" align="left" valign="top"><img src="http://www.astralplanet.co.uk/test/et/images/slogan.gif" alt="Enjoy the gift of learning..."></td>
	<td width="579" align="center" class="maincontentarea"> </td>
	<td width="136" align="right" class="navpanel"> </td>
     </table>
  </tr>
</table>

</body>
</html>
__________________
BioRUST Tutorials - the birthplace

Last edited by scrowler; 07-18-2005 at 12:01 PM.
scrowler is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-18-2005   #5 (permalink)
Registered User
 
DeathByPixels's Avatar
 
Join Date: Jul 2005
Location: Cornwall, UK
Posts: 8

Send a message via ICQ to DeathByPixels Send a message via AIM to DeathByPixels Send a message via MSN to DeathByPixels Send a message via Yahoo to DeathByPixels Send a message via Skype™ to DeathByPixels
I see, thanks. But I did that as advised and it didn't help, so any suggestions?
__________________
Talk Digital Design - A web and graphic design tutorial website with forums, gallery, articles, *auction house, *video tutorials and *link directory - currently under development.
Features marked with * will be added at a later date.
DeathByPixels is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-18-2005   #6 (permalink)
get nasty!
 
Uncle Ghed's Avatar
 
Join Date: Jun 2005
Location: Rome, Italy
Posts: 82

Send a message via MSN to Uncle Ghed
Colspan gives a <td> tag the capability of spanning itself over more than one cell. Tables in html are a rigid grid, so if you have row with five cells, html wants you to have 5 cells in every row of your table. This is unless you use the colspan attribute, giving it the number of cells you want to span. You can do this vertically too, with the rowspan attribute.

Looks like the problem is that the first cell on the top left corner is too big, and it gives the width attribute to your whole column. You should probably nest a table in your second row to have more freedom...

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Energetic Training</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>

<table class="pageborders" align="center" width="750" border="0" cellpadding="0" cellspacing="0">
<!-- Header -->
  <tr>
  	<td class="headerbackground" height=92><img src="http://www.astralplanet.co.uk/test/et/images/title.gif" alt="Energetic Training"></td>
  	<td class="headerbackground" height="92" colspan="2">&nbsp;</td>
  </tr>
<!-- END Header -->
  <tr>
  	<td colspan="2">
  	<!-- NESTED TABLE -->
  		<table border="0" cellpadding="0" cellspacing="0">
  			<tr>
  				<td width="35" align="left" valign="top"><img src="http://www.astralplanet.co.uk/test/et/images/slogan.gif" alt="Enjoy the gift of learning..."></td>
				<!-- Main Content Area -->
					<td width="579" align="center" class="maincontentarea">&nbsp;</td>
				<!-- END Main Content Area -->
				<!-- Navigation -->
					<td width="136" align="right" class="navpanel">&nbsp;</td>
				<!-- END Navigation -->
				</tr>
			</table>
			
		</td>
	</tr>
</table>

</body>
</html>

hope i've helped...
__________________
some day I'll understand why on earth I started drawing...
Uncle Ghed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-18-2005   #7 (permalink)
code anyone?
 
scrowler's Avatar
 
Join Date: Feb 2004
Location: New Zealand
Posts: 590

Send a message via MSN to scrowler Send a message via Skype™ to scrowler
*post updated - check updated code*

i believe uncle ghed's second solution is the same or similar so his should work too.

please keep in mind that most of your code is not xhtml, it is html. the difference is that you cannot use attribute tags like: align, valign, width, cellspacing, cellpadding, border. you have to use their css equivalents. you also cannot use capital letters in tags, and you must enclose all values in double quotes (<tag style="css.code: something">)
__________________
BioRUST Tutorials - the birthplace
scrowler is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP/mySQL tables MrProtoman HTML / PHP / ASP / JS 4 10-31-2004 03:12 AM
Xhtml Young Spartan HTML / PHP / ASP / JS 8 01-06-2004 01:31 PM
Tables vs. CSS? Young Spartan HTML / PHP / ASP / JS 7 01-05-2004 03:27 PM


All times are GMT +1. The time now is 05:04 AM.
Content Relevant URLs by vBSEO 3.2.0

Design & Content © BioRUST 2008 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT