How To Absolute Vertical center align a table?

  • nightshader
  • Novice
  • Novice
  • No Avatar
  • Joined: Feb 28, 2004
  • Posts: 16
  • Status: Offline

Post May 27th, 2004, 10:39 pm

Like title. I cant figure this out. I had it setup before but forgot how to do it.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 27th, 2004, 10:39 pm

  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Mar 24, 2004
  • Posts: 1855
  • Loc: Uk
  • Status: Offline

Post May 28th, 2004, 1:17 am

Quote:
How To Absolute Vertical center align a table? Like title


I'm sorry if I sound rude, but you are much more likely to get help if elaborate a little. You seem to have a whole bunch of different properties all mixed together in that sentence and I'm really not sure what you are asking.
CSS website design tutorials
  • nightshader
  • Novice
  • Novice
  • No Avatar
  • Joined: Feb 28, 2004
  • Posts: 16
  • Status: Offline

Post May 31st, 2004, 2:34 pm

Sorry, I thought that would clearly explain what i ask, but seem like it complicate it more. All i want is how to valign a table in the middle. But I figure it out. Thanks.
  • Axe
  • Genius
  • Genius
  • User avatar
  • Joined: Jan 07, 2004
  • Posts: 5744
  • Loc: Sub-level 28
  • Status: Offline

Post May 31st, 2004, 2:43 pm

<table align="center">

or

<center><table>blah blah blah blah
</table></center>
  • nightshader
  • Novice
  • Novice
  • No Avatar
  • Joined: Feb 28, 2004
  • Posts: 16
  • Status: Offline

Post May 31st, 2004, 7:50 pm

See, they didnt understand what i want. I want a vertical align table, not horizontal align table. But i figure it out. Thanks. Post closed.
  • Axe
  • Genius
  • Genius
  • User avatar
  • Joined: Jan 07, 2004
  • Posts: 5744
  • Loc: Sub-level 28
  • Status: Offline

Post May 31st, 2004, 11:51 pm

Then post your solution here for others to learn ;)

Your initial question was kind of vague (to put it mildly), but after reading it again several times...

Code: [ Select ]
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td align="center" valign="middle">
<table border="1" width="300"><tr><td>Hey look at me! I'm in the middle!</td></tr></table>
</td></tr></table>
  1. <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td align="center" valign="middle">
  2. <table border="1" width="300"><tr><td>Hey look at me! I'm in the middle!</td></tr></table>
  3. </td></tr></table>
  • nightshader
  • Novice
  • Novice
  • No Avatar
  • Joined: Feb 28, 2004
  • Posts: 16
  • Status: Offline

Post June 1st, 2004, 7:29 am

Axe wrote:
Then post your solution here for others to learn ;)

Your initial question was kind of vague (to put it mildly), but after reading it again several times...

Code: [ Select ]
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td align="center" valign="middle">
<table border="1" width="300"><tr><td>Hey look at me! I'm in the middle!</td></tr></table>
</td></tr></table>
  1. <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td align="center" valign="middle">
  2. <table border="1" width="300"><tr><td>Hey look at me! I'm in the middle!</td></tr></table>
  3. </td></tr></table>


You have the rite code there. But becarefull, if you have sth like this in the begining of the page
Code: [ Select ]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

it wont work. You have to remove the
Code: [ Select ]
"http://www.w3.org/TR/html4/loose.dtd"
for it to be middle valign. Hope this help anyone.
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Mar 24, 2004
  • Posts: 1855
  • Loc: Uk
  • Status: Offline

Post June 1st, 2004, 7:49 am

Um, am I right in thinking you have only tested this in internet Explorer. What you are seeing is internet explorer's quirks mode, I doubt very much if you will get the same result in every browser.
CSS website design tutorials
  • sir.wiggles
  • Born
  • Born
  • No Avatar
  • Joined: Feb 05, 2008
  • Posts: 3
  • Status: Offline

Post February 5th, 2008, 3:13 pm

ok, huge bump here :P

I am wondering how i would vertically center align this table.
The table is already horizontally aligned (center) but i am not sure how to vertically align it.

Code: [ Select ]
<div align="center">
 <table width="800" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCFF" style="border:solid 1px #333333;>
  <!--DWLayoutTable-->
  <tr>
   <td height="121" colspan="2" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
  </tr>
  <tr>
   <td width="224" height="479" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
   <td width="576">&nbsp;</td>
  </tr>
 </table>
</div>
  1. <div align="center">
  2.  <table width="800" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCFF" style="border:solid 1px #333333;>
  3.   <!--DWLayoutTable-->
  4.   <tr>
  5.    <td height="121" colspan="2" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
  6.   </tr>
  7.   <tr>
  8.    <td width="224" height="479" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
  9.    <td width="576">&nbsp;</td>
  10.   </tr>
  11.  </table>
  12. </div>
  • dyefade
  • Expert
  • Expert
  • User avatar
  • Joined: May 22, 2004
  • Posts: 712
  • Loc: UK
  • Status: Offline

Post February 5th, 2008, 4:02 pm

Hehe, look at all that code, before everyone got their heads around CSS.

Whatever happened to rtm?
  • sir.wiggles
  • Born
  • Born
  • No Avatar
  • Joined: Feb 05, 2008
  • Posts: 3
  • Status: Offline

Post February 5th, 2008, 4:53 pm

the file format i am using is .html
anyway i can sort it without css?

basically is there a space is the below for which i can put something like valign or something in.
Code: [ Select ]
<div align="center">

<table width="800" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCFF" style="border:solid 1px #333333;>
  1. <div align="center">
  2. <table width="800" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCFF" style="border:solid 1px #333333;>
  • neksus
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Sep 10, 2004
  • Posts: 2194
  • Loc: Canada
  • Status: Offline

Post April 1st, 2008, 8:46 pm

Why do you want to sort it without CSS? You're already using it...
Code: [ Select ]
<div align="center">

is the same as
Code: [ Select ]
<center>


But your answer is
Code: [ Select ]
<table width="800" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCFF" valign="middle" style="border:solid 1px #333333;>


Alternatively, with CSS, you can do
Code: [ Select ]
<table width="800" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCFF" style="border:solid 1px #333333; margin: auto 0">
  • larsen1492
  • Born
  • Born
  • No Avatar
  • Joined: Apr 07, 2009
  • Posts: 1
  • Status: Offline

Post April 7th, 2009, 11:32 am

The easiest way i think is css. Here is an example:
http://n1scripts.com/css_scripts/css_ve ... ipts&id=16

Post Information

  • Total Posts in this topic: 13 posts
  • Users browsing this forum: roelof and 139 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.