0

I have a database , which has a "data" column with "TEXT" data type. So I want to fetch that row having data with new lines(like I like cooking) and also number of spaces ( like I'm cooking). I get the output as I like cooking ....and ... I'm cooking. I know the html neglects the blankspaces and newline characters and we need to use &nbsp for it... But when the data is enormous , applying &nbsp can be cumbersome. Can any one suggest any method to solve it ? I'd be very thankful to ur answers..

  • possible duplicate of [HTML/CSS - Best practice for preserving white space on certain elements?](http://stackoverflow.com/questions/8994516/html-css-best-practice-for-preserving-white-space-on-certain-elements) – David May 09 '15 at 14:26
  • Yup That worked ;) (y) Thank you Mr.David.. – Aditya Singh Parmar May 09 '15 at 14:35

1 Answers1

0

You should use white-space: pre for elements that need. And your HTML code should be in the certain box with a ID name, something like this:

<div id='test'>
// anything
<div>

then for CSS: // table and link

#test tr, #test a{white-space: pre;}