Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CSS text overflow flexible columb width

Posted on 2006-07-08
3
Medium Priority
?
720 Views
Last Modified: 2012-05-05
recently i was trying to make columb for a bulk text which needs to get hidden like the gmail subject
i used

overflow:hidden;white-space:nowrap;
 
which works perfectly in firefox...but to make it work in IE and firefox i need to use

text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:300px;

which again works fine in both but then i dont have a flexible width...for which i tried width:100%; instead of width:300px; but this dosnt work in IE.

can anyone tell me how to emulate the gmail subject columb?
0
Comment
Question by:loving_chronic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Accepted Solution

by:
mdg12 earned 1000 total points
ID: 17066973
I noticed that gmail handles the onresize event -- not sure exactly what they're doing but they could be dynamically resizing the cell in IE..  I looked at the style in Firefox (using FireBug inspector) and there was nothing special going on, but it could be a totally different css for IE

You could try something like the following (but add a check and only do it for IE, because onresize is triggered only when resizing is finished in Firefox so it would be "sluggish")

<html>
<head>
<script>
function scale()
{
var newwidth = document.body.clientWidth-20; //20 for scrollbar
document.getElementById('div1').style.width = newwidth;
}
</script>
</head>
<body onload="scale()" onresize="scale()">
<div id="div1" style="overflow:hidden;white-space:nowrap">this is a lot of textthis is a lot of textthis is a lot of textthis is a lot of textthis is a lot of textthis is a lot of textthis is a lot of textthis is a lot of textthis is a lot of textthis is a lot of text</div>
</body>
</html>
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

596 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