Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorThompson
    • CommentTimeMar 3rd 2006
     permalink
    Hi, folks! :)
    This is my first topic, I´m new here. I hope someone of you can help me :D

    Here is my problem:
    I have a td element (a HTML column) , and inside this td i have a div, just like the following code:

    <table style="border: 1px solid #000000;" cellpadding="2">
    <tr>
    <td id="td1" style="width:50px; border: 1px solid #FF0000;" nowrap><div style="overflow: hidden; width: 100%; border: 1px solid #00FF00;" nowrap>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>
    </td>
    </tr>
    </table>

    Very simple, as you see.
    However, something is wrong here.... notice that the div has the same witdh that the td, and because this the width of td should be the same as the div, but this is not occuring.
    As you can see, the td width is being expanded until the big string ends, and I do not want this. I want the td in the same width as the div (here, 50px), and not with the width of the big string. Got it??

    Make a test... change the "width: 100%" style of div to something like "width: 100px;", and it will work.
    But the fact is that i need this width to be in percentage, because this table is being created dinamically.

    I hope I could be very transparent in my explanation, and sorry about my english... I´m brazillian. :)

    Thanks for the help!!
    • CommentAuthoreisnah
    • CommentTimeMar 3rd 2006
     permalink
    Hello there:)
    I dont see a problem here, works well in all browsers...
    •  
      CommentAuthoranblik
    • CommentTimeMar 4th 2006 edited
     permalink
    Lets me first congrats you of using overflow:hidden as the solution :) Yes, that is the only way round.

    There is no real fix for IE Expnding Box behavior (float drop), excpt to work around or avoid it.
    <!--[if IE]>
    <style type="text/css">
    body {word-wrap: break-word;}
    </style>
    <![endif]-->

    In short, both word-wrap: break-word & overflow: hidden are only possible workarounds that will make IE respect your specified width and dimension.
    • CommentAuthorThompson
    • CommentTimeMar 4th 2006
     permalink
    Hum... just as I thought, there´s no way to fix it...

    The problem in fact is that this table is only an example. In my project, this is one of some table that will be created dinamically by a xml.
    And more, after the creating of all tables, the project have a zoom tool that expands all tables and divs inserted into their columns. That´s the reason i´ve put a % width on the div, and not a fixed value.

    I could do this zoom fix with javascript dinamically, but the result was too slow because a for instruction that run all the divs and resize all of them...

    In another words... I have to negotiate again with my client, and search for another solution for this, I guess.... hehe

    In spite of this... thank you so much for the help!!
    I think putting the style in body by css is the best way.

    Cya! :D
    •  
      CommentAuthoranblik
    • CommentTimeMar 4th 2006
     permalink
    better then DOM (if JS disabled) is to create small PHP function or whatever scripting you may be using and which will add ( - hyphen) after certain characters. Filter-out all words using this function. This will work in any circumstances.
Add your comments
    Username Password
  • Format comments as (Help)