[PHP] text wrap in table
Hi, I am creating a program for a newspaper to publish their article online. There is a form what allows them to cut and past from their editors (word, pagemaker, staroffice). The data is being entered correctly. The problem is when I try and get the data from the table the whole matter scrolls off the screen. I need it to be formatted as the client cut and pastes it (headings, paras, etc). Below is my table and part of my program. mysql desc newsarticles; +--+--+--+-+++ | Field| Type | Null | Key | Default| Extra | +--+--+--+-+++ | id | int(5) | | PRI | NULL | auto_increment | | nid | int(5) | | MUL | 0 || | headline | varchar(100) | | ||| | article | mediumtext | | ||| | date | date | | | -00-00 || | imgpath | varchar(200) | YES | | NULL || +--+--+--+-+++ html head title? echo $row-headline; ?/title /head body bgcolor=white h1 align=center? echo $row-headline; ?/h1 h3 align=center? echo $row-description; ?/h3 table width=600 border=1 tr td valign=top width=70%font face=Arial size=2 color=bluestrong? echo $sd .-. $sm .-. $sy; ?/strongbrpre? echo $row-article; ?/pre/font/td td valign=top width=30%img src=? echo $row-imgpath; ? ? echo $iwh[3]; ? /td /tr /table /body /html I use the pre/pre to display with the line breaks. If I take of the pre it does not wrap but does not give the breaks. To my thinking maybe while entering the data we should give break the lines physically. This is part of my entry form. tr tdfont face=Arial size=2HeadLine/font/td tdinput type=text name=headline size=30 /tr tr tdfont face=Arial size=2Article/font/td tdtextarea name=article cols=60 rows=10/textarea/td /tr tr tdfont face=Arial size=2Upload Image/font/td tdinput type=file name=userfile size=30 wrap=ON/td /tr tr align=center td colspan=2input type=submit value=Submit/td /tr How do I get the text not to wrap and to preserve the formatting given by the client. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] text wrap in table
Have you tried using the nobr tag along with the pre tag? The nobr tag will not allow the text to wrap. You can use it outside the pre tags and see what you come up with. It sounds simple, but it may provide you with the solution that you need. Navid -Original Message- From: Adrian D'Costa [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 23, 2001 11:36 PM To: php general list Subject: [PHP] text wrap in table Hi, I am creating a program for a newspaper to publish their article online. There is a form what allows them to cut and past from their editors (word, pagemaker, staroffice). The data is being entered correctly. The problem is when I try and get the data from the table the whole matter scrolls off the screen. I need it to be formatted as the client cut and pastes it (headings, paras, etc). Below is my table and part of my program. mysql desc newsarticles; +--+--+--+-+++ | Field| Type | Null | Key | Default| Extra | +--+--+--+-+++ | id | int(5) | | PRI | NULL | auto_increment | | nid | int(5) | | MUL | 0 || | headline | varchar(100) | | ||| | article | mediumtext | | ||| | date | date | | | -00-00 || | imgpath | varchar(200) | YES | | NULL || +--+--+--+-+++ html head title? echo $row-headline; ?/title /head body bgcolor=white h1 align=center? echo $row-headline; ?/h1 h3 align=center? echo $row-description; ?/h3 table width=600 border=1 tr td valign=top width=70%font face=Arial size=2 color=bluestrong? echo $sd .-. $sm .-. $sy; ?/strongbrpre? echo $row-article; ?/pre/font/td td valign=top width=30%img src=? echo $row-imgpath; ? ? echo $iwh[3]; ? /td /tr /table /body /html I use the pre/pre to display with the line breaks. If I take of the pre it does not wrap but does not give the breaks. To my thinking maybe while entering the data we should give break the lines physically. This is part of my entry form. tr tdfont face=Arial size=2HeadLine/font/td tdinput type=text name=headline size=30 /tr tr tdfont face=Arial size=2Article/font/td tdtextarea name=article cols=60 rows=10/textarea/td /tr tr tdfont face=Arial size=2Upload Image/font/td tdinput type=file name=userfile size=30 wrap=ON/td /tr tr align=center td colspan=2input type=submit value=Submit/td /tr How do I get the text not to wrap and to preserve the formatting given by the client. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] text wrap in table
rant on Please, DO NOT USE the pre tag, or fonts fixed in point size. You have no control over the device which will display the page, let the web function the way it's supposed to. Users run screens at various resolutions, in Windows maybe large fonts or small fonts. If the user wants bigger type, then let her kick up the font size in the browser. Why? I'm 53 years old, my father is 84, and my oldest child is 16. Our visual acuity varies greatly. rant off Direct the client to sites like salon, which are elegantly done with the goal of readability and clarity on the screen. Or LinuxToday. For the opposite, kick your monitor to high resolution, then go to some of the dipstick sites linked from msn.com, e.g.www.bcentral.com/resource/articles/homeoffice/101.asp, and then try the Print-friendly version. It still displays and prints in about 9 pt type. Persuade the client that the web is a different medium, and presentation has to change. If they resist, then generate PDF's and call by reference from the database. Regards - Miles Thompson At 03:47 AM 8/24/01 -0500, Navid Yar wrote: Have you tried using the nobr tag along with the pre tag? The nobr tag will not allow the text to wrap. You can use it outside the pre tags and see what you come up with. It sounds simple, but it may provide you with the solution that you need. Navid -Original Message- From: Adrian D'Costa [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 23, 2001 11:36 PM To: php general list Subject: [PHP] text wrap in table Hi, I am creating a program for a newspaper to publish their article online. There is a form what allows them to cut and past from their editors (word, pagemaker, staroffice). The data is being entered correctly. The problem is when I try and get the data from the table the whole matter scrolls off the screen. I need it to be formatted as the client cut and pastes it (headings, paras, etc). Below is my table and part of my program. mysql desc newsarticles; +--+--+--+-+++ | Field| Type | Null | Key | Default| Extra | +--+--+--+-+++ | id | int(5) | | PRI | NULL | auto_increment | | nid | int(5) | | MUL | 0 || | headline | varchar(100) | | ||| | article | mediumtext | | ||| | date | date | | | -00-00 || | imgpath | varchar(200) | YES | | NULL || +--+--+--+-+++ html head title? echo $row-headline; ?/title /head body bgcolor=white h1 align=center? echo $row-headline; ?/h1 h3 align=center? echo $row-description; ?/h3 table width=600 border=1 tr td valign=top width=70%font face=Arial size=2 color=bluestrong? echo $sd .-. $sm .-. $sy; ?/strongbrpre? echo $row-article; ?/pre/font/td td valign=top width=30%img src=? echo $row-imgpath; ? ? echo $iwh[3]; ? /td /tr /table /body /html I use the pre/pre to display with the line breaks. If I take of the pre it does not wrap but does not give the breaks. To my thinking maybe while entering the data we should give break the lines physically. This is part of my entry form. tr tdfont face=Arial size=2HeadLine/font/td tdinput type=text name=headline size=30 /tr tr tdfont face=Arial size=2Article/font/td tdtextarea name=article cols=60 rows=10/textarea/td /tr tr tdfont face=Arial size=2Upload Image/font/td tdinput type=file name=userfile size=30 wrap=ON/td /tr tr align=center td colspan=2input type=submit value=Submit/td /tr How do I get the text not to wrap and to preserve the formatting given by the client. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]