Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 10-29-2004, 02:34 PM   #1 (permalink)
Redline
PHP Student
 
Join Date: Oct 2004
Location: Forest Grove, OR
Posts: 150
Redline is on a distinguished road
Send a message via AIM to Redline Send a message via MSN to Redline
Quick question on <table>'s

Ugh, this is a really simple question but I really need the answer. On my website, I made a server status table that shows what map is playing on my CS server, as well as listing the players. Unfortunately players with long names w/o spaces in them don't get wrapped to the next line, they just extend the table beyond the container border. This only happens in Firefox/Mozilla though. In Explorer it wraps the lines no matter what.

Anyone know of a specific table element I can use to make sure Mozilla based browsers wrap the text to the next line?
__________________
Current Project
Redline is offline   Reply With Quote
Old 10-29-2004, 06:52 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
just use php ..
PHP Code:
if( strlen($playername) > 10 ){
  
// shorten player name
  
$playername substr($playername,0,10);

alternatively, you could insert a <br> tag with php after the 10th character too.
__________________
Mike
sde is offline   Reply With Quote
Old 10-30-2004, 02:00 PM   #3 (permalink)
Redline
PHP Student
 
Join Date: Oct 2004
Location: Forest Grove, OR
Posts: 150
Redline is on a distinguished road
Send a message via AIM to Redline Send a message via MSN to Redline
I went ahead an limited the names to 18 charactors. Is there a function I can use to insert a string into another string at any given charactor?
__________________
Current Project
Redline is offline   Reply With Quote
Old 10-30-2004, 08:12 PM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
PHP Code:
$name "abcdefghijklmnopqrstuvwxyz";
if(
strlen($name)>18){
  
$name substr($name,0,18)."<br>".substr($name,18);
}
echo 
$name
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick way to select a random array element? Epsilon PHP 4 03-11-2004 04:49 PM
quick & dirty app for xp sde Windows 6 07-25-2003 07:43 PM
Quick Reply Box Admin Feedback 2 07-09-2003 07:15 AM
DB Design Question Part II sde Program Design and Methods 3 05-10-2003 12:24 PM
Quick anti-aliasing question ntws01 Java 2 03-20-2003 06:00 PM


All times are GMT -8. The time now is 01:48 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting