SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Centering content
-
Nov 2, 2003, 21:53 #1
- Join Date
- Mar 2002
- Location
- Vancouver, BC
- Posts
- 1,971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Centering content
Hi,
for my index page, I have a table with 2 columns. What i wanna do is center the table both horizontally [i can do that] and vertically.
I dont really know how to make the table appear in the middle of the screen.
My search on this forum came up with mostly centering popup windows...
Do you guys get what I'm trying to say here? Help me out on this .
thx
asT.
-
Nov 2, 2003, 22:34 #2
- Join Date
- Apr 2000
- Location
- Melbourne
- Posts
- 832
- Mentioned
- 4 Post(s)
- Tagged
- 0 Thread(s)
The 'Height' ttribute is buggy so you'll probalby have to use CSS margins. Try something like this for a start.
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> #content { margin:20% 20%; text-align:center; border:1px solid red } </style> </head> <body> <div id="content"> <table width="300" border="1" cellpadding="0" cellspacing="0"> <tr> <th scope="col"> </th> </tr> <tr> <td>sdfsdfsdf</td> </tr> <tr> <td> </td> </tr> </table> </div> </body> </html>
-
Nov 3, 2003, 01:19 #3
- Join Date
- May 2003
- Posts
- 1,843
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
::: certified wild guess :::
-
Nov 3, 2003, 01:44 #4
- Join Date
- Mar 2002
- Location
- Vancouver, BC
- Posts
- 1,971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
awesome stuff guys. worked perfectly
thanks.
Bookmarks