Solved

Scrollable PHP Text Box output Table

Posted on 2011-03-15
6
306 Views
Last Modified: 2012-05-11
Hello Experts,

Im a little confused as how i output data into a scrollable text box, it is set up in the database as 255 varchar, but dont know how to make the table scrollable for "last spoken to" and "notes"

Please could you assist me,

Output of table is attached in code.

thanks
echo"<table>";
   echo "<tr><td>Company:</td><td>".$row['customer_name']."</td></tr>";
    echo "<tr><td>Account Number:</td><td><a href=\"account.php?val=".$row['account_number']."\">".$row['account_number']."</a></td></tr>";
	 echo "<tr><td>Contact Name:</td><td>".$row['contact_name']."</td></tr>";
	 echo "<tr><td>Telephone Number:</td><td>".$row['telephone_number']."</td></tr>";
	 echo "<tr><td>Fax:</td><td>".$row['fax']."</td></tr>";
	 echo "<tr><td>Contact Mob Number:</td><td>".$row['contact_mobile']."</td></tr>";
	 echo "<tr><td>Address:</td><td>".$row['full_address']."</td></tr>";
	 echo "<tr><td>Network:</td><td>".$row['network']."</td></tr>";
	 echo "<tr><td>Last Spoke To:</td><td>".$row['last_spoke_to']."</td></tr>";
	 echo "<tr><td>Notes:</td><td>".$row['notes']."</td></tr>";
	 echo "<tr><td>Kit Fund Level:</td><td>".$row['kit_fund_level']."</td></tr>";
   echo"</table>";

Open in new window

0
Comment
Question by:NeoAshura
  • 4
  • 2
6 Comments
 
LVL 5

Expert Comment

by:meb_santoso
ID: 35137924
Did you mean something like this : (see screenshot)

images

Then it's not really a PHP-issue, it's CSS/HTML stuff :-)

Your script:
echo "<tr><td>Last Spoke To:</td><td>".$row['last_spoke_to']."</td></tr>";

Open in new window


Change it to:
echo "<tr><td>Last Spoke To:</td><td>"
[b]<div style="width: [u]190px[/u];height: [u]250px[/u];overflow:auto;">
[/b].$row['last_spoke_to'].[b]</div>[/b]"</td></tr>";

Open in new window


Adjust the width and height accordingly.
0
 
LVL 5

Expert Comment

by:meb_santoso
ID: 35137933
sorry, I put the "new" version betweet code-tags.

It should be like this:

echo "<tr><td>Last Spoke To:</td><td>"
<div style="width: 190px;height: 250px;overflow:auto;">
.$row['last_spoke_to'].</div>"</td></tr>";

0
 
LVL 6

Author Comment

by:NeoAshura
ID: 35138004
i dont believe you can put div tags inside of php..

any other ideas?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 5

Accepted Solution

by:
meb_santoso earned 500 total points
ID: 35138115
correction:
echo "<tr><td>Last Spoke To:</td><td>
<div style=\"width: 190px;height: 250px;overflow:auto;\">"
.$row['last_spoke_to']."</div></td></tr>";
0
 
LVL 6

Author Comment

by:NeoAshura
ID: 35138162
cheers buddy
0
 
LVL 5

Expert Comment

by:meb_santoso
ID: 35138242
:-)
0

Featured Post

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
spacing 5 27
WooCommerce Sort by Date 4 6
Error installing extension Linux 4 28
showing numeric numbers 2 8
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now