Jump to content

Align text


Ache

Recommended Posts

This is the code I have:

echo "Gebruikersnummer : $userData[0] <br>\n";echo "Gebruikersnaam : $userData[1] $userData[2] <br>\n";echo "Uw verdiende credits : $aantal<p>\n";

What I want is the :'s aligned nicely under eachother. I know I can do it with a table by putting the text in the first column and the variables in the second column. But I would like to know if php provides a (easier?) way. I just started learning php and where possible I want to use php and not html, javascript or something else.

Link to comment
Share on other sites

Php creates html as output, so if you can find an html layout that works to align the colon's, have your php script produce the output in the acceptable manner.Php does not do any 'formatting' by itself. It will require html and CSS for styling the page as you wish.

Link to comment
Share on other sites

Browsers understand HTML, not PHP. PHP can be used to filter, manipulate, and even generate HTML, but what the browser receives is HTML pure and simple.The HTML spec provides several ways for aligning elements by character, but I've never seen any of them correctly implemented.As you said, you can split your data into separate table cells or divs and align that way. That's your best bet.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...