Results 1 to 6 of 6

Thread: CSS for table alignment

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Resolved CSS for table alignment

    what is the CSS attribute for table postion if i want align the table to center??
    Last edited by kenny_oh; Nov 25th, 2005 at 07:08 PM.

  2. #2
    Hyperactive Member Sgt-Peppa's Avatar
    Join Date
    Mar 2003
    Location
    Munich - Germany
    Posts
    476

    Re: CSS for table alignment

    Do you mean something like this?
    Code:
    <HTML>
    	<HEAD>
    		<TITLE>Center a Table</TITLE>
    	</HEAD>
    	<BODY>
    		<DIV align="center">
    			<TABLE border="1">
    				<TR>
    					<TD>
    						First Row, First Cell
    					</TD>
    					<TD>
    						First Row, Second Cell
    					</TD>
    				</TR>
    				<TR>
    					<TD>
    						Second Row, First Cell
    					</TD>
    					<TD>
    						Second Row, Second Cell
    					</TD>
    				</TR>
    			</TABLE>
    		</DIV>
    	</BODY>
    </HTML>
    Stephan
    Keep Smiling - even if its hard
    Frankie Says Relax, wossname Says Yeah!
    wossname:--Currently I'm wearing a gimp suit and a parachute.
    C# - Base64 Blog

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: CSS for table alignment

    no...anyway.....the problem is solved!!

  4. #4
    Hyperactive Member gjon's Avatar
    Join Date
    Nov 2004
    Location
    Inescapable Void
    Posts
    442

    Re: CSS for table alignment

    Quote Originally Posted by kenny_oh
    no...anyway.....the problem is solved!!
    What was the solution you found?

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: CSS for table alignment

    Code:
    margin-left:100px

  6. #6
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765

    Re: CSS for table alignment

    Quote Originally Posted by kenny_oh
    Code:
    margin-left:100px
    lol, thats not centered.

    You need to center the containing div (so its compatible with IE) or whatever, and then do,
    margin-left:auto;
    margin-right:auto;

    I believe.
    Don't Rate my posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width