Jump to content

Simulating ALT+Enter in PHP codes or in HTML or in Javascript


sherbetlemon

Recommended Posts

guys,, how can I simulate ALT+Enter in PHP?? I have this script which exports data to excel using namespace I have data which contain long texts and some formatting in them.. whenever the generation of excel file encounters <br/> or <p> it moves from the current cell to the next cell,, is there a way to prevent it from moving to the next cell???

 

Any help will be highly appreciated!!! Thanks in advance!! :)

I don't have a windows machine to test it on, but you will probably have to escape the newline characters in the CSV that don't denote a new row of cells...

 

"line 1", "data 1", "this is a \\ndescription\\non multiple lines"
"line 2", .........

I don't have a windows machine to test it on, but you will probably have to escape the newline characters in the CSV that don't denote a new row of cells...

 

"line 1", "data 1", "this is a \\ndescription\\non multiple lines"
"line 2", .........

 

\n didb't work,, same with chr(10) or chr(13)

PHP runs server-side, I'm not real sure what exactly it is your trying to do.

 

hmmm,, i'm generating excel files using php and namespace, it moves from the current cell to the next cell everytime the scripts encounter

<br/>, <div>,<p>

in the data which should not be the case.. is there a way to not make it move to the next cell,, I guess what i'm trying to say is that how can i do line break in a cell???

I'm sorry, but I don't use Excel, so I have NO idea what you're talking about.  You could try removing the tags from the data or using htmlspecialchars on it. o-O

 

Thanks DarkWater.. actually, I've already done that.. but they want to retain all the html formatting on the cell,, they want the data to look exactly as it is on the web page... :'(

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.