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>"); } ?> Quote Link to comment 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\">"; Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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.) Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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! 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.