dna23
Member
Registered: 1st Nov 04
Location: Northamptonshire
User status: Offline
|
want to find a stable way of centreing a table vertically on a website.... any ideas?
|
ed
Member
Registered: 10th Sep 03
User status: Offline
|
How do you mean?
|
Jamie
Member
Registered: 1st Apr 02
Location: Aberdeen
User status: Offline
|
What you got so far...?
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
edit - never mind, thought you meant setting a table centre of screen 
eitherway - just use valign under the td tag, should set what ever is in there vertically centre 
[Edited on 23-08-2005 by Dom]
|
dna23
Member
Registered: 1st Nov 04
Location: Northamptonshire
User status: Offline
|
not that simple i'm afraid Dom.... i've created a series of images within a table and need it to be centred vertically on the page not just horizontally...
there's various CSS2 and div codes but IE/win doesn't support them
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
quote: Originally posted by dna23
not that simple i'm afraid Dom.... i've created a series of images within a table and need it to be centred vertically on the page not just horizontally...
there's various CSS2 and div codes but IE/win doesn't support them
you got the page live anywhere? placing the table inside another and then setting the tr/td tags to align centre etc etc should solve it?
|
dna23
Member
Registered: 1st Nov 04
Location: Northamptonshire
User status: Offline
|
sorted it out mate... used 2 javascript codes 
http://adambessell.i8.com
|
dna23
Member
Registered: 1st Nov 04
Location: Northamptonshire
User status: Offline
|
<script src="main/1.js"></script>
<script src="main/2.js"></script>
<script>
//<![CDATA[
var o = this;
o.onload = function()
{
var brws = new Browser();
this.desk = new Desktop(brws);
};
o.popWindow = function(url)
{
this.desk.popWindow(url, "paypal", 800, 600, "scrollbars=yes");
};
//]]>
</script>
<style>
/*<![CDATA[*/
body {
margin: 0px;
background-color: #FFFFFF;
}
div {
border: 1px solid #FFFFFF;
position: absolute;
width: 400px;
height: 607px;
left: 50%;
top: 50%;
margin-left: -210px;
/*\*/
margin-top: -300px;
/**/
}
/*]]>*/
</style>
then <div> table code </div>
with the relevant 1.js and 2.js works with all browsers aswell
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
Put it inside another table, which has a height 100% (which is not in the standards but most modern browsers render).
Simple example here - http://www.ruralweddings.com/
|
dna23
Member
Registered: 1st Nov 04
Location: Northamptonshire
User status: Offline
|
sadly i did it the hard way but thanks for future referance... only problem is height 100% isn't supported on erm... Netscape i think it is and maybe Opera or one of the others
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
quote: Originally posted by Ian
Put it inside another table, which has a height 100% (which is not in the standards but most modern browsers render).
Simple example here - http://www.ruralweddings.com/
was what i was going on about - but didnt explain it properly . And 100% width/height is supported in most browsers - certainly firefox/opera/IE - just leaves netscape (not sure about), and tbh it would be a small percentage that use that now
|