Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I 'text-align' php output inside a DIV ?

Status
Not open for further replies.

c0deM0nK424

Programmer
Oct 28, 2007
126
0
0
GB
so basicaly i have two div columns, on a main page.

and in the first div ive got a php script that reads from a mysql database table, and outputs the records INSIDE that div accordingly.

I've used that overflow scroll property to ensure that the php output stays fixed inside that div and it works nicely. The alternatively was to implement paging inside the div itself, but thats currently beyond the scope of my expertise - that or im too lazy to break up all the code and re-implementing it heh

Not that I couldn't do it - but sometimes the simpler approach is often the best one.


The problem is - the php output is aligned against the left of the DIV box, formats nicely - but i'd like to implement some form of 'space' or 'margin' or padding even so that the php output isn't aligned so closely to the left.

any tips or ideas on how to go abouts doing this ?
 
The text-align property is not a Php deal, but CSS, as are margin, and padding.

If you need to give your div padding or margin, do It in its CSS. Php has no reason to be involved in that.



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
The text-align property is not a Php deal, but CSS, as are margin, and padding. "

I understand. My question is:

i was merely asking if I could manipulate the positioning of the output nothing more, i've sorted that out now so its cool. [bigsmile]
 
If its CSS, why are you asking in PHP. All it does is output HTML. If you need padding and margins, you need to add CSS, Sherlock.

Php has no control over how the HTML is displayed. It merely sends it back to the browser.



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Public forums are a useful place for others if we post our solutions. How did you sort this out with PHP without CSS?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top