How To Fix <TD> Element Size?

This is a discussion on "How To Fix <TD> Element Size?" within the Web Page Design section. This forum, and the thread "How To Fix <TD> Element Size? are both part of the Design Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Nov 29th, 2005, 03:36
Junior Member
Join Date: Nov 2005
Age: 28
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
How To Fix <TD> Element Size?

Hi everybody, i have a problem to fix the size of the <TD> element, can some one help me? Belows is my code:

Code: Select all
<HTML>
   <HEAD><TITLE>Testing</TITLE></HEAD>
   <BODY>
      <TABLE Border="1" Width="100%">
      <TR>
         <TD Width="17%">Original Message</TD>
         <TD>
         <DIV id="fraGroup" scrolling="yes" class=textboxWidthSet style="height:100;overflow-
y:scroll;overflow-x:scroll;background-color:#FFFFFF;border:groove 1px #FFFFFF">
TestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTesting
TestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTesting
TestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTesting
</DIV>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 29th, 2005, 12:33
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,160
Blog Entries: 7
Thanks: 27
Thanked 19 Times in 16 Posts
Re: How To Fix <TD> Element Size?

Add this to your CSS styles for that element:
word-wrap: break-word
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Dec 1st, 2005, 00:27
Junior Member
Join Date: Nov 2005
Age: 28
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How To Fix <TD> Element Size?

Hi Rob,

I put it in the CSS style and <TD word-wrap:break-word> element, i also add this before HTML tag:

Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 //EN"
   "http://www.w3.org/TR/REC-html40/strict.dtd">
<HTML>
    :
</HTML>
But the result still same. The Width of the first <TD> is shifted. Actually, Width='17%' in the first <TD> is enough to display the text 'Original Message:' in one line, but because the word in the second <TD> is too long and force the text 'Message:' to the new line, so the width is not 17%.

How can i fix the width and display the text in just one line?

Do u or anybody have an idea to do this?

Last edited by ivan; Dec 1st, 2005 at 00:31.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Dec 1st, 2005, 03:38
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How To Fix <TD> Element Size?

To make it so the td expands with the text, just dont add a width.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Dec 1st, 2005, 15:00
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,160
Blog Entries: 7
Thanks: 27
Thanked 19 Times in 16 Posts
Re: How To Fix <TD> Element Size?

Quote:
Originally Posted by ivan
<TD word-wrap:break-word>
This is wrong.

Add the style to the div tag, like so:-
HTML: Select all
<DIV id="fraGroup" scrolling="yes" class=textboxWidthSet style="height:100;overflow-
y:scroll;overflow-x:scroll;word-wrap:break-word;background-color:#FFFFFF;border:groove 1px #FFFFFF">
Although, why you dont just use an external CSS file is beyond me.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Dec 4th, 2005, 23:31
Junior Member
Join Date: Nov 2005
Age: 28
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How To Fix <TD> Element Size?

Thank you Rob, now i can solve the problem.

Thanks a lot..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Dec 11th, 2005, 18:43
New Member
Join Date: Dec 2005
Location: Egypt
Age: 25
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How To Fix <TD> Element Size?

I think specify a fixed width may solve the problem like:
HTML: Select all
<td width="100">
you text here
</td>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
fix, lttdgt, element, size

Thread Tools

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
help on removing element using yui shotokan99 JavaScript Forum 1 Aug 31st, 2007 13:42
using params in xsl IF element zzqproject Other Programming Languages 0 Nov 21st, 2005 23:12
XHTML Block Element in an Inline Element gohankid77 Web Page Design 6 Jul 27th, 2004 10:15


All times are GMT. The time now is 04:34.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42