Jump to content

Almost done w/ my crazy php - I just need to center my text in the page...


JTapp

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.