-
[RESOLVED]TEXT Field
when i show a text field into area box from table, it comes nicely with formated text but when i try to show in a <td>, its messed up.
like
in area box -
Istiaque Sami
Ambarkhana
Sylhet - 3100
Bangladesh
in TD
Istiaque Sami Ambarkhana Sylhet - 3100
Bangladesh
why?
-
Re: TEXT Field
because line breaks do not show up in HTML pages unless you break the line using the "<BR>" tag. you can simply do this before you put it in the <TD>:
PHP Code:
//assuming $data is your information, you can do this:
$data = str_replace("\n", "<br />", $data);
$data = str_replace("\r", "", $data);
//now, you can put it in the td
echo "<td>$data</td>\n";
This will remove line breaks and carriage returns from your data and replace them with one line break in HTML.
-
Re: TEXT Field
Thanks. Its working nicely.