Link to home
Start Free TrialLog in
Avatar of JavascriptBeginner
JavascriptBeginner

asked on

A simple question about table width

<!-- I created a table which has three columns. I want the first column and last column to be static(which does not change its width), and the middle one when the browser gets resized, I want the overflow to be hidden. I added a style for overflow:hidden, but it still shows up...I don't want to give fixed width(because it has dynamic content).Please help to fix this.-->


<body onLoad="innertext();">
<table class="FavBar" width="100%" id="FavBar" onContextMenu="FavBarContextMenu();">
      <tr>
            <td id="FavbarLeftEndcap" style="font-family:Tahoma; font-size:9px;width:140px;">
                  <a onClick="GetList();" style="cursor:hand;" onMouseOver="this.style.textDecoration='underline';" onMouseOut="this.style.textDecoration='none';">
                   <nobr>
                   <img src="images/icon_grey_folder.gif" width=12 height=12 align="absmiddle">
                   <span id="scrname" l10n="_text">Loading...</span>
                   </nobr>
                  </a>
            </td>
            <td id="IEFavorites" align="left" style="position:relative; padding-right:25px" >
                  <span id="FavoritesArea"  style="overflow:hidden;cursor:hand; height:14px; white-space:nowrap;"></span>
                  <div id="FavOverflow" align="right" style="display:none;width:25px;font-size:0px;padding-right:5px; right:0px; position:absolute">
                        <img src="images/overflow_arrow.gif"   style="cursor: hand;" align="absmiddle">
                  </div>
            </td>
      </tr>
</table>
</body>
ASKER CERTIFIED SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
is this a mistake in your code or what??  

<<<<<<<<<<<<<  <span id="scrname" l10n="_text">Loading...</span>

l10n="_text" ?

<body onLoad="innertext();">
<table class="FavBar" width="100%" id="FavBar" onContextMenu="FavBarContextMenu();">
     <tr>
          <td id="FavbarLeftEndcap" style="font-family:Tahoma; font-size:9px;width:140px;">
               <a onClick="GetList();" style="cursor:hand;" onMouseOver="this.style.textDecoration='underline';" onMouseOut="this.style.textDecoration='none';">
                <nobr>
                <img src="images/icon_grey_folder.gif" width=12 height=12 align="absmiddle">
                <span id="scrname" l10n="_text">Loading...</span>
                </nobr>
               </a>
          </td>
          <td id="IEFavorites" align="left" style="position:relative; padding-right:25px" >
               <span id="FavoritesArea"  style="overflow:hidden;cursor:hand; height:14px; width:<your fixed width here>";white-space:nowrap;"></span>
               <div id="FavOverflow" align="right" style="display:none;width:25px;font-size:0px;padding-right:5px; right:0px; position:absolute">
                    <img src="images/overflow_arrow.gif"   style="cursor: hand;" align="absmiddle">
               </div>
          </td>
     </tr>
</table>
</body>

sean
Avatar of JavascriptBeginner
JavascriptBeginner

ASKER

Thats not a mistake...l10n is a internationalization tag. With that tag and a script we can change the text to any language dynamically.
I cannot give fixed width, because the content of the span is going to be dynamic by javascript.Is there any other solution?
What does dynamic content have to do with the width?  You want overflow when content is wider than the container.  If you are going to set the width based on content then there is no overflow.

You can't have it both ways. Either it is fixed width with overflow, or it is dynamic width and there is no overflow.  You can flip back and forth between presentation formats but at any given point in time it must be one or the other it cannot be both.

Cd&
I never asked for fixed width. I  do not want to give fixed width when the content is less...because it occupies unwanted space. I want it to overflow only when the content is more.
I guess there is some kind of communication problem. <B><U><BLINK> Without fixed width there is no overflow.</BLINK></U></B>  

You either generate the page with the styling you need or you analyze the content on the client and do it with script.  Either way just looking at content and coming up with the right setting is little more than a guess; and even if you get it right, the user can do a settings change that messes it up.

Cd&
Avatar of Michel Plungjan
PS: An answer you do not like might still be a valid answer. Please do not punish bearers of bad news