Echo a title for a table

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
aussie_clint
Forum Commoner
Posts: 41
Joined: Mon Jul 31, 2006 9:14 am
Location: Brisbane, Australia
Contact:

Echo a title for a table

Post by aussie_clint »

i got a mysql databas returning a result in a table and im try to do a heading for it, but y will it let me do this?

Code: Select all

Echo "<p>Systems</p>";
but not this?

Code: Select all

Echo "<p align="center">Systems</p>";
gunman
Forum Newbie
Posts: 10
Joined: Fri Aug 26, 2005 12:07 pm

Post by gunman »

Try to escape string like this

Code: Select all

Echo "<p align=\"center\">Systems</p>";
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Or you could use

Code: Select all

echo '<p align="center">Systems</p>';
With single quotes cannot use \n or variables inside, you have to use concatenation but can make things more readable.

Might be worth noting that you should probably use the <caption> Html Tag within a table rather than a <p> tag. Makes it easier to deal with CSS.
Post Reply