[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Limiting width of a table cell regardless of text content

Asked by stefanlennerbrant in Hypertext Markup Language (HTML), Internet Explorer Web Browser, Cascading Style Sheets (CSS)

Tags: html break-word cell

I'd like to display some text in a one-row-only table cell, not overflowing the containing text outside of the cell (or expanding the cell)
However, the cell itself "doesn't know its own width". And I don't know anything at all about the text that shall be displayed.

Today, I'm using something like the html below.
The "nowrap" together with the "overflow:hidden" makes the text display on one single row.
I don't know the size of the image to the right of the text, so I cannot say how wide the cell itself will be.
However, I know that the whole table shall be 500px wide. Thus, the image cell shall be "as small as possible" (just containing the image) and the text cell shall cover the rest of the table width (500px minus the image width)

If I change the span to <span style="overflow:hidden; width:350;"> -- then all is perfect. But I don't know what the proper width shall be here, as it depends on the (unknown) image.
And if I don't use a "width:xxx" then the cell will be expanded to contain all the text (on one row). Not good!


I've also tried to remove the "nowrap" and use a <span style="height:1.2em; overflow:hidden; word-wrap:break-word;">
Then the cell never expands, but instead my text will be cut off at a word break -- thus, the "last word" will not display at all, even though several characters should have fitted in the cell (I thought that "break-word" would do the trick, but obviously it doesn't)
Also, this method does not at all work with at least some non-IE browsers (like Firefox).


<table width=500 border=1 cellspacing=0 cellpadding=0><tr valign=top><td>
This is how wide the page should be (contained in the table below)
</td></tr></table>
<br>
<table width=500 style="width:500;" border=0 cellspacing=0 cellpadding=0><tr valign=top><td>
  <table border=1 width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr valign=top>
    <td>
      <table border=1 border=0 cellspacing=0 cellpadding=0>
      <tr valign=top>
        <td nowrap>
            <span style="overflow:hidden;">
              Testing_long_words 1 testing_long_words 2 testing_long_words 3 testing_long_words 4 testing_long_words 5
            </span>
        </td>
      </tr>
      </table>
    </td>
    <td width="1%" align=right>
      <img src="/somepicture.gif" border=0>
    </td>
  </tr>
  </table>
</td></tr></table>

Any ideas?

/Stefan Lennerbrant
[+][-]12/13/08 04:02 PM, ID: 23166020Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/13/08 04:37 PM, ID: 23166079Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/14/08 05:24 AM, ID: 23167599Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/14/08 06:52 AM, ID: 23167804Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Hypertext Markup Language (HTML), Internet Explorer Web Browser, Cascading Style Sheets (CSS)
Tags: html break-word cell
Sign Up Now!
Solution Provided By: GreenGhost
Participating Experts: 2
Solution Grade: A
 
[+][-]02/01/09 05:48 PM, ID: 23523982Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/04/09 02:38 PM, ID: 25491136Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_EXPERT_20070906