简体   繁体   中英

How do I keep data in a textarea as is?

What I am trying to do is save data from a textarea as is. When I save write data into my textarea and format it as I want after I save it in my database it ignores all of what I did and saves it a plain text. For example I tried to save something like:

Fruit    Apple    Banana    Kiwi    Orange
Tom        1        2         0        5
Jerry      0        0         4        1
Cindy      0        0         0        8

But when I put them into the database they come out like this:

Fruit Apple Banana Kiwi Orange Tom 1 2 0 5 Jerry 0 0 4 1 Cindy 0 0 0 8

I want to keep the format that I gave it at the begging.

Is it possible to add tables to it?

You can't do this with simple textArea. You have to use ckeditor or other editor.

ckeditor

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM