?
Solved

A simple question about table width

Posted on 2004-11-16
10
Medium Priority
?
184 Views
Last Modified: 2010-04-09
<!-- 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>
0
Comment
Question by:JavascriptBeginner
8 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 200 total points
ID: 12599633
If you do not assign a width then nothing is considered overflow.  

Cd&
0
 
LVL 16

Expert Comment

by:ellandrd
ID: 12602510
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
0
 

Author Comment

by:JavascriptBeginner
ID: 12615133
Thats not a mistake...l10n is a internationalization tag. With that tag and a script we can change the text to any language dynamically.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:JavascriptBeginner
ID: 12615145
I cannot give fixed width, because the content of the span is going to be dynamic by javascript.Is there any other solution?
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12616477
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&
0
 

Author Comment

by:JavascriptBeginner
ID: 12619950
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.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12620280
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&
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 13524048
PS: An answer you do not like might still be a valid answer. Please do not punish bearers of bad news
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question