What is the data type to use for a description?

I would like to know what data type I need to use for a description.

example:

Baseball cap by adidas Originals 
-   Made from cotton
-   Embroidered brand logo to the front
-   Five panel styling
-   Ventilation holes to the side

What data type do I need to use so when I want to use this data it still contain the spaces and indents?

Answer #1:

It has nothing to do with the data type. You can use varchar or text. If you are trying to render as HTML then you'll want to render it between <pre> tags.

Answered By: pyrospade

Answer #2:

Your text will be saved as it is, your text render is the one that has to understand the line breaks, indents, etc.

You can use any alphanumeric datatype.

Answered By: Euclides Mulémbwè
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .



# More Articles