hanlonj Posted June 16, 2007 Share Posted June 16, 2007 Hi, I have a number of lines of code which display information to the screen. <code> $msg .= "Name : $name \n"; $msg .= "Address : $address \n"; </code> I want to be able to put tabs in between the "Name" and "$name" so I can align all the data in a column to look easier on the eye. How do I do this? I think it's something like "/t" but i'm not sure. hj Link to comment https://forums.phpfreaks.com/topic/55823-place-a-tab-in-between-data/ Share on other sites More sharing options...
chigley Posted June 16, 2007 Share Posted June 16, 2007 You can use for the equivalent of a tab key output. You'd be better using a table though! Link to comment https://forums.phpfreaks.com/topic/55823-place-a-tab-in-between-data/#findComment-275734 Share on other sites More sharing options...
redarrow Posted June 16, 2007 Share Posted June 16, 2007 \n <<< new line \t <<< tab \n\t <<< new line and tab   << space on a line nl2br($varable) << brake at new line from form input wordwrap($varable,10,"<br>") << brake at number 10 Link to comment https://forums.phpfreaks.com/topic/55823-place-a-tab-in-between-data/#findComment-275736 Share on other sites More sharing options...
chigley Posted June 16, 2007 Share Posted June 16, 2007 \t only outputs a tab in the source of the output. Unless told otherwise, HTML will ignore all whitespace (including tabs) so you will have to use to have the actual tab outputted to the page. Link to comment https://forums.phpfreaks.com/topic/55823-place-a-tab-in-between-data/#findComment-275737 Share on other sites More sharing options...
hanlonj Posted June 16, 2007 Author Share Posted June 16, 2007 Thanks guys. Another thing, I have all my form fields stored in variables and they are all being passed to my processor file except for one. It's a "text area" and when I echo it, it displays blank. It is inside the form and variable names are correct. I cannot figure this out. Is there anything different about text areas? hj Link to comment https://forums.phpfreaks.com/topic/55823-place-a-tab-in-between-data/#findComment-275763 Share on other sites More sharing options...
AndyB Posted June 16, 2007 Share Posted June 16, 2007 a textarea is just another input. If it does not appear to be passed along, there's something wrong with your code (variable names duplicated, variable names mismatched, data display code error, etc.). Hard to fix what we can't see. Link to comment https://forums.phpfreaks.com/topic/55823-place-a-tab-in-between-data/#findComment-275781 Share on other sites More sharing options...
hanlonj Posted June 16, 2007 Author Share Posted June 16, 2007 a textarea is just another input. If it does not appear to be passed along, there's something wrong with your code (variable names duplicated, variable names mismatched, data display code error, etc.). Hard to fix what we can't see. Thanks.Uppercase/lowecase conflict. sorted now. hj Link to comment https://forums.phpfreaks.com/topic/55823-place-a-tab-in-between-data/#findComment-275786 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.