Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


TABLE fixed width -how to?



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> HTML Forum
View previous topic :: View next topic  
Author Message
bebil



Joined: 21 Oct 2005
Posts: 2

PostPosted: Fri Oct 21, 2005 8:56 am    Post subject: TABLE fixed width -how to? Reply with quote

Hi guys,

I got a table and I insert information into it from a textarea (not important). My problem is that I specify the width =164 and also the width of the TD as 164. i also have put the nowrap tag in the TD.

However when info is entered into the table and its bigger than 164 wide it just expands the width instead of scrolling below onto the next line.

I have also tried to put the content in the TD into a DIV (with width of 164 ) but still no luck.

code:
<table width="164" border="0" class="contentTableRight" >
<tr>
<td width="164" nowrap><h2>Latest Work</h2>
<div style="width:164px">
<?
if (isset($textHTML))
echo($textHTML);
?>
</div>
</td>
</tr>
</table>


PLEASE can someone advise me to as whats causing it to extend or what I can do to restrict it.

thanks in advance
Back to top
View user's profile Send private message
webmaster
Site Admin


Joined: 17 Aug 2004
Posts: 3590
Location: Sweden

PostPosted: Fri Oct 21, 2005 9:29 am    Post subject: Re: TABLE fixed width -how to? Reply with quote

I can't figure out a good way to do it in HTML. But this is some things you can do with PHP. Try this:


PHP:
an style="color: #000000"><?php <?php $textHTML "11111111111111111111111111111"?>

<table border="0">
<tr>
<td bgcolor="red" width="164">
<?php
if (isset($textHTML)) {
if(
strlen($textHTML) >= 18) {
echo 
substr($textHTML018) . "<br />" substr($textHTML1836);
} else {
echo 
$textHTML;
}
}
?>
</td>
</tr>
</table> 
Back to top
View user's profile Send private message Visit poster's website
bebil



Joined: 21 Oct 2005
Posts: 2

PostPosted: Fri Oct 21, 2005 10:17 am    Post subject: Re: TABLE fixed width -how to? Reply with quote

hi, sorry I was doing something very dumb,.... my test data was mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

or something to that effect so it treated it like 1 word and couldnt break it down so it could be put on a different line.

thanks alot for your help...much appreciated.
Back to top
View user's profile Send private message
webmaster
Site Admin


Joined: 17 Aug 2004
Posts: 3590
Location: Sweden

PostPosted: Fri Oct 21, 2005 12:07 pm    Post subject: Re: TABLE fixed width -how to? Reply with quote

Did my solution work? It will work with up to words with 36 chars.

Another solution cuold be a scroll like:
Code:
<div style="width:160px;overflow:scroll;">111111111111111111111111111</div>
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> HTML Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap