Results 1 to 3 of 3

Thread: new row if enter is pressed?

  1. #1
    Join Date
    Aug 2006
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default new row if enter is pressed?

    Hey, I need to change the row when I press enter but I dont want to use the textarea tag because of the scroller on the right. Some browser always have them even if its not needed... Anyways how can I change row if it looks something like this:

    HTML Code:
    <td>
    my text here
    
    and here
    </td>
    And I want it to look like this:
    My text here

    and here

    instead of: My text here and here

    Edit:

    This may belong to the php section, anyways I use php so if theres some function I can use I would love to find out how it works

    Edit again:

    Got it to work
    Last edited by Dennis_Gull; 04-20-2007 at 09:19 PM.

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    You could use nl2br function in php to accomplish this, if I understand you correctly. Something else you could try is simply inserting a <br> in between the lines of text. So this:

    Code:
    <td>
    my text here
    
    and here
    </td>
    would be this:

    Code:
    <td>
    my text here<br>
    <br>
    and here
    </td>
    and that will ouput like so:

    my text here

    and here
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Aug 2006
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yeah nl2br was what I used, the reason why I wanted it as normal text is because the text is supposed to be posted by others on my site.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •