This is a discussion on Edit word or rtf file... need tables! within the PHP General forums, part of the PHP Programming Forums category; Hello, I want a dynamically growing table based off a template we have, i'm trying to replace a section ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
I want a dynamically growing table based off a template we have, i'm trying to replace a section of the document with a table using php. If I use RTF, I have tried numerous code segments to create tables but I always get a table that either stretches forever or looks really weird with a big X in the last column. Using .doc, word has cryptic code for everything, I can start searching through for a table but it might be messy. Is there any other formats I could explore and keep my template? |
|
|||
|
{ rowd rgaph300 rleft400\cellx1500\cellx3000\cellx4500\pard\intbl Doo
wah ditty ditty dum ditty do \cell \pard\intbl Doo wah ditty ditty dum ditty do \cell \pard\intbl Doo wah ditty ditty dum ditty do \cell ow rowd rgaph300 rleft400\cellx1500\cellx3000\cellx4500 \pard\intbl Doo wah ditty ditty dum ditty do \cell \pard\intbl Doo wah ditty ditty dum ditty do \cell \pard\intbl Doo wah ditty ditty dum ditty do \cell ow rowd rgaph300 rleft400\cellx1500\cellx3500 \pard\intbl Doo wah ditty ditty dum ditty do \cell \pard\intbl Doo wah ditty ditty dum ditty do \cell ow } After php replaces the string and saves my rtf file... If I open it in notepad I see that "/row" is being chopped up to "ow" as well as all other \t and \r ... which are escape sequences...just added another / to make sure it doesn't escape and voila. |
|
|||
|
gooderthanyou@gmail.com wrote:
> { rowd rgaph300 rleft400\cellx1500\cellx3000\cellx4500\pard\intbl Doo > wah ditty ditty dum ditty do \cell > \pard\intbl Doo wah ditty ditty dum ditty do \cell > \pard\intbl Doo wah ditty ditty dum ditty do \cell > ow rowd rgaph300 rleft400\cellx1500\cellx3000\cellx4500 > \pard\intbl Doo wah ditty ditty dum ditty do \cell > \pard\intbl Doo wah ditty ditty dum ditty do \cell > \pard\intbl Doo wah ditty ditty dum ditty do \cell > ow rowd rgaph300 rleft400\cellx1500\cellx3500 > \pard\intbl Doo wah ditty ditty dum ditty do \cell > \pard\intbl Doo wah ditty ditty dum ditty do \cell > ow > } > > After php replaces the string and saves my rtf file... If I open it in > notepad I see that "/row" is being chopped up to "ow" as well as all > other \t and \r ... which are escape sequences...just added another / > to make sure it doesn't escape and voila. > After a quick internet search I found this: http://www.terrawebdesign.com/multidimensional.php I don't know if it is close enough to what you want to do to be of help. It might be a little more complicated than what you are looking to do. If you are unfamiliar with php arrays be sure to reference: http://www.php.net/manual/en/language.types.array.php If you have specific question about how to get from this example to your solution someone here might be able to help. |