JTapp Posted February 19, 2008 Share Posted February 19, 2008 I can't believe I can find help on in depth php / MySql stuff, but nothing is out there on simple coding for formatting. I've been pointed to Editing software.. but I don't understand how to use it. Can somebody just tell me how to center the following code on my webpage? Thanks in advance for your time. print ("<tr>"); echo '<p><h3>' . $variable1 . '</h3></p><p>' . $variable2 . '</p>'; echo '<p>' . $variable3 . '</p>'; echo "<a href=\"$variable4\">Click Here To Go To The Lodge Website</a>"; echo '<p>' . $variable5 . '</p>' . $variable6 . '</p>'; echo '<p>' . $variable7 . '</p>' . $variable8 . '</p>' . $variable9 . '</p>' . $variable10 . '</p>' . $variable11 . '</p>'; echo "<a href=mailto:\"$variable12\">Click Here To Email The Lodge</a>"; echo '</p>' . $variable13 . '</p>' . $variable14 . '</p>'; echo '<p>' . $variable15 . '</p>'; echo '<p>' . $variable16 . '</p>' . $variable17 . '</p>' . $variable18 . '</p>'; echo '<p>' . $variable19 . '</p>'; echo "<img src='{$row['link']}'>"; print ("</tr>"); } AND my table: print ("<tr>"); echo "<td class=\"td_id\"><h3>$variable1</h3></td>\n"; echo "<td class=\"td_id\"><h3>$variable2</h3></td>\n"; echo "<td class=\"td_id\"><h3>$variable3</h3></td>\n"; echo "<td class=\"td_id\"><h3>$variable4</h3></td>\n"; echo "<td class=\"td_id\"><h3>$variable5</h3></td>\n"; print ("</tr>"); } ?> Link to comment https://forums.phpfreaks.com/topic/91814-almost-done-w-my-crazy-php-i-just-need-to-center-my-text-in-the-page/ Share on other sites More sharing options...
marcus Posted February 19, 2008 Share Posted February 19, 2008 echo "<center>\n"; // other stuff echo "</center>\n"; for your table echo "<tr align=\"center\">"; Link to comment https://forums.phpfreaks.com/topic/91814-almost-done-w-my-crazy-php-i-just-need-to-center-my-text-in-the-page/#findComment-470223 Share on other sites More sharing options...
trq Posted February 19, 2008 Share Posted February 19, 2008 Its usually best to learn html before php, php has nothing to do with the layout of your pages. Link to comment https://forums.phpfreaks.com/topic/91814-almost-done-w-my-crazy-php-i-just-need-to-center-my-text-in-the-page/#findComment-470226 Share on other sites More sharing options...
vicodin Posted February 19, 2008 Share Posted February 19, 2008 Tables are your friend... Your entire site should be built in tables... The only way your gonna have consistant text alignment. Link to comment https://forums.phpfreaks.com/topic/91814-almost-done-w-my-crazy-php-i-just-need-to-center-my-text-in-the-page/#findComment-470238 Share on other sites More sharing options...
JTapp Posted February 19, 2008 Author Share Posted February 19, 2008 You guys are great. Thanks for taking the time. I've got it centered now. I'm also wanting my results to be tighter.. they are looking double spaced. Can one of you guys take a look and tell me if they are as tight as they can get? Thanks again. Link to comment https://forums.phpfreaks.com/topic/91814-almost-done-w-my-crazy-php-i-just-need-to-center-my-text-in-the-page/#findComment-470239 Share on other sites More sharing options...
kenrbnsn Posted February 19, 2008 Share Posted February 19, 2008 Tables are your friend... Your entire site should be built in tables... The only way your gonna have consistant text alignment. I hope you said that in jest -- tables should only be used to display tabular information, you really should learn CSS. Ken Link to comment https://forums.phpfreaks.com/topic/91814-almost-done-w-my-crazy-php-i-just-need-to-center-my-text-in-the-page/#findComment-470244 Share on other sites More sharing options...
vicodin Posted February 19, 2008 Share Posted February 19, 2008 I hope you said that in jest -- tables should only be used to display tabular information, you really should learn CSS. I dont mean write a table for evey line of text in your site i mean the skeleton on your site is all tables. If you disagress i would like to know how you keep everything is place. (Not being sarcastic.) Link to comment https://forums.phpfreaks.com/topic/91814-almost-done-w-my-crazy-php-i-just-need-to-center-my-text-in-the-page/#findComment-470256 Share on other sites More sharing options...
kenrbnsn Posted February 19, 2008 Share Posted February 19, 2008 If you disagress i would like to know how you keep everything is place. (Not being sarcastic.) This getting away from PHP ... you keep everything in it's place with the proper use of classes, ids, divs and spans. As an example, here is a picture gallery I wrote to display my digital pictures. Most people would use tables to display the thumbnails, but on this site there are none to be found. Actually, if you look at the code, the thumbnails are really list items that are floated. One thing that falls out from doing it this way is that if you reduce the width of the browser window, the thumbnail reflow automatically. Too really appreciate what CSS can do for your sites, see css Zen Garden CSS can be very powerful when used correctly. Ken Link to comment https://forums.phpfreaks.com/topic/91814-almost-done-w-my-crazy-php-i-just-need-to-center-my-text-in-the-page/#findComment-470271 Share on other sites More sharing options...
vicodin Posted February 19, 2008 Share Posted February 19, 2008 Yea its off topic so this is my last post on it. With tables you have better borwser compatibility and resolution compatability. You web page will look most consistant in all browser using tables, samething with resolution. Link to comment https://forums.phpfreaks.com/topic/91814-almost-done-w-my-crazy-php-i-just-need-to-center-my-text-in-the-page/#findComment-470275 Share on other sites More sharing options...
timmy0320 Posted February 19, 2008 Share Posted February 19, 2008 If you disagress i would like to know how you keep everything is place. (Not being sarcastic.) This getting away from PHP ... you keep everything in it's place with the proper use of classes, ids, divs and spans. As an example, here is a picture gallery I wrote to display my digital pictures. Most people would use tables to display the thumbnails, but on this site there are none to be found. Actually, if you look at the code, the thumbnails are really list items that are floated. One thing that falls out from doing it this way is that if you reduce the width of the browser window, the thumbnail reflow automatically. Too really appreciate what CSS can do for your sites, see css Zen Garden CSS can be very powerful when used correctly. Ken Nice! My CSS skills are complete n00b. I know the basics of color formatting and that's it. That right there really intrigued me to get more into CSS formatting. I really hate tables! Link to comment https://forums.phpfreaks.com/topic/91814-almost-done-w-my-crazy-php-i-just-need-to-center-my-text-in-the-page/#findComment-470292 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.