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>");

}

?>

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.

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

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.)

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

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.

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! 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.