sanderphp Posted February 16, 2009 Share Posted February 16, 2009 I'm using a simple script to display a quote on the screen. I added the table line to get the output to appear in the center, but its still at the top of the screen. How do I get it centered in the middle of the page vertically? <TABLE HEIGTH=75% WIDTH=75% BORDER="0" VALIGN="Middle" ALIGN="center"> <?php echo '<head>'; echo ' <link rel="stylesheet" href="styles.css" type="text/css">'; echo '</head>'; require( "config.php" ); $Quote = new CQuote; if( $Quote->Get( $strQuote ) == 0 ) echo $strQuote; ?> </table> Quote Link to comment Share on other sites More sharing options...
haku Posted February 16, 2009 Share Posted February 16, 2009 Height is spelled 'height'. Quote Link to comment Share on other sites More sharing options...
sanderphp Posted February 16, 2009 Author Share Posted February 16, 2009 Other than that typo it should work correctly right? I can't get it to. Quote Link to comment Share on other sites More sharing options...
sanderphp Posted February 16, 2009 Author Share Posted February 16, 2009 My table is appearing below the php script output. How do I return the value if the script inside the table? Quote Link to comment Share on other sites More sharing options...
haku Posted February 16, 2009 Share Posted February 16, 2009 You are outputting 'head' tags and a css link in the middle of your table. Those have to go before any HTML output. Quote Link to comment Share on other sites More sharing options...
sanderphp Posted February 16, 2009 Author Share Posted February 16, 2009 Even this way, the output is still displayed above the table. <head> <link rel="stylesheet" href="styles.css" type="text/css"> </head> <TABLE HEIGHT=75% WIDTH=75% BORDER="2" VALIGN="Middle" ALIGN="center"> <?php require( "config.php" ); $Quote = new CQuote; if( $Quote->Get( $strQuote ) == 0 ) echo $strQuote; ?> </table> Quote Link to comment Share on other sites More sharing options...
haku Posted February 16, 2009 Share Posted February 16, 2009 Show us the output. Quote Link to comment Share on other sites More sharing options...
sanderphp Posted February 16, 2009 Author Share Posted February 16, 2009 I don't want to post my public domain here, but it's just the text, with a table underneath it. I want the text to be inside the box. Quote Link to comment Share on other sites More sharing options...
9three Posted February 16, 2009 Share Posted February 16, 2009 change the domain to xxxxxxxx.com Quote Link to comment Share on other sites More sharing options...
sanderphp Posted February 16, 2009 Author Share Posted February 16, 2009 http://www.sanderandmeena.com/php/notes/examples/complete/quotes.php Quote Link to comment Share on other sites More sharing options...
9three Posted February 16, 2009 Share Posted February 16, 2009 The HTML seems fine. It's inside the table. Quote Link to comment Share on other sites More sharing options...
corbin Posted February 16, 2009 Share Posted February 16, 2009 Learn basic HTML before moving to PHP. Look up a table tutorial because you're doing it entirely wrong. Tables have rows and cells. Quote Link to comment Share on other sites More sharing options...
9three Posted February 16, 2009 Share Posted February 16, 2009 /Agreed Although it *is* inside the table element but you need to add the <tr> and <td> to it. Quote Link to comment Share on other sites More sharing options...
sanderphp Posted February 16, 2009 Author Share Posted February 16, 2009 What color font are you seeing? I just checked on another pc and this one shows white text while the other shows black text and not table box Quote Link to comment Share on other sites More sharing options...
9three Posted February 16, 2009 Share Posted February 16, 2009 red background. black text Quote Link to comment Share on other sites More sharing options...
sanderphp Posted February 16, 2009 Author Share Posted February 16, 2009 Thanks, that's all I needed was the tr and td tags. I forgot that those were required for a table to function correctly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.