Solved

Scrollable PHP Text Box output Table

Posted on 2011-03-15
6
308 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

825 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