Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 10-04-2005, 04:08 PM Stretching Table
Extreme Talker

Posts: 219
Location: UK, East Anglia
Trades: 0
I have made a simple forum, but when someone enters text like:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
The table streches, is there anyway i can stop this, also when some starts a new line (presses enter) when its displayed it ignores the new line.
timsquash5 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-04-2005, 04:44 PM
sdcdesign.co.uk's Avatar
Extreme Talker

Posts: 198
Location: High Wycombe, Buckinghamshire, London
Trades: 0
Ok,

1. for your table you need to add some style to it. Say your table is called 'main-table' :

Code:
<style type="text/css">
.main-table { table-layout: fixed; }
</style>
2. When a new message is posted, in your programming language used, replace '\n' with '<br>'


should work.
__________________
[ Insert witty, yet highly intelligent signature here ]
sdcdesign.co.uk is offline
Reply With Quote
View Public Profile Visit sdcdesign.co.uk's homepage!
 
Old 10-05-2005, 11:18 AM
stoot98's Avatar
Ultra Talker

Posts: 427
Name: Stuart
Location: Glasgow, Scotland
Trades: 0
If your using PHP you can use the nl2br() function to change the \n to br.

PHP Code:
$body nl2br($body); 
stoot98 is offline
Reply With Quote
View Public Profile
 
Old 10-05-2005, 01:20 PM
Extreme Talker

Posts: 219
Location: UK, East Anglia
Trades: 0
I get this

http://tinypic.com/e9u24k.jpg

My html is

Quote:
<table bgcolor="#000000" cellspacing="1" cellpadding="5" width="80%" style="table-layout:fixed">
<tr bgcolor="#bdd8fe">
<td colspan="2">
test
</td>
</tr>
<tr bgcolor="#ffffff">
<td width="100" align="center">
<img src="images/avatars/tim.gif">
<br>
<a href="profile.php?username=Tim"><font color="blue"><strong>Tim</strong></font></a>
<br>
Posts: 103
</td>
<td valign="top">
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa
</td>
</tr>
...
timsquash5 is offline
Reply With Quote
View Public Profile
 
Old 10-05-2005, 03:02 PM
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
Will you ever actually have text in there that does not have a space in it? The lack of spaces is causing the run-out. To scroll the content or chop it, repectively, try setting the TD's style to "overflow: scroll" or "overflow: hidden"

Or just make the table width to be automatic, so the page with scroll to the size of the content.

Most non-breaking strings of text that long will break a site, but it looks like this forum puts a space in automatically. You could code that as well.
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Reply     « Reply to Stretching Table
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.60086 seconds with 12 queries