Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8710073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:31:46+00:00 2026-06-13T04:31:46+00:00

The text that I am trying to echo from $data is way too long

  • 0

The text that I am trying to echo from $data is way too long and it is going off the screen beyond the boundaries of the table. In addition to that all the text is getting displayed without line breaks (or blank lines) or proper spacing.

My simple PHP code:

<div id="sampleid1" class="tabcontent" style="margin-left:48px;">
    <table width="510" border="0" cellspacing="4" cellpadding="4" class="SampleClass">
        <tr>
            <td>
                <?php echo Sample1_LABEL;?>
            </td>
            <th align="left"><strong>:</strong>
            </th>
            <td>
                <?php echo $data[ 'Sample1'];?>
            </td>
        </tr>
        <tr>
            <td>
                <?php echo Sample2_LABEL;?>
            </td>
            <th align="left"><strong>:</strong>
            </th>
            <td>
                <?php echo $data[ 'Sample2'];?>
            </td>
        </tr>
    </table>
</div>

In Summary:

  1. I need the text that I am retrieving using the $data to get formatted in such a way that the line breaks are displayed in the output upon echoing.
  2. I need that output text to be scrollable so no text will go off the screen beyond the boundaries.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:31:48+00:00Added an answer on June 13, 2026 at 4:31 am

    You can try this

    <td>
       <div style="height:100px; overflow:auto">
          <?php echo $data['Sample2'];?>
       </div>
    </td>
    

    You can also try

    echo(nl2br($data['Sample2']));  //converts newline to <br /> html tag
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to add data from my ajax query that returns json
I have a code that populates data from a mysql table into an html
I am trying to populate a text field with data from a MySQL database,
I am trying to correct a text that has some very typical scanning errors
I'm trying to save information about text that a user has highlighted in a
I have a gzipped text file that I'm trying to read within PHP (using
I am trying to implement a control to edit text that will display the
I'm trying to parse some UTF-8 encoded html text that contains the left and
I am trying to convert a block of text that contains html text -
I'm trying to build a text formatter that will add p and br tags

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.