Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8643655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:06:15+00:00 2026-06-12T12:06:15+00:00

I really could use some help with some style issue I fail to get

  • 0

I really could use some help with some style issue I fail to get solved:

Scenario:

Inside a web application I have a table visualizing a list of entries. Two of the columns can take longer content, which is chopped for display using “overflow:hidden;”and applying a “text-overflow:ellipsis”. The content of all table cells is wrapped into spans so that I can apply animations whilst populating the table. All fine.

Now I want to change the tables layout from its former fixed style to a more liquid behaviour.

Before I had fixed width settings for the table columns. For all except two columns I keep the fixed width, even for one of the ellipsis-style-chopped columns. The other one gets a width of 100%, so that the table consumes the whole available container, thus giving a liquid style (“always use whole screen”). The column shows its content plus some whitespace which is used to pad as required.

Desired behaviour:

I expect the table to shrink when the windows size is decreased. This should obviously happen by reducing the width of the column set to 100%, since it is the only one without a fixed length. That part works only as long as the cells content fits in. As soon as the window gets that narrow, that the content does not fit any more a scrollbar is applied by the browser. This is not what I want. Instead I want the ellipsis-style-rules to chop that cells content, so that the table actually gets smaller, maybe up to a min-width.

Test case:

HTML:

<div>
<table>
<tr>
  <td class="c1"><span class="ellipsis">Alfreds Futterkiste</span></td>
  <td class="c2"><span class="ellipsis">Maria Anders</span></td>
  <td class="c3"><span class="ellipsis">Germany</span></td>
</tr>
<tr>
  <td class="c1"><span class="ellipsis">Laughing Bacchus Winecellars</span></td>
  <td class="c2"><span class="ellipsis">Yoshi Tannamuri</span></td>
  <td class="c3"><span class="ellipsis">Canada</span></td>
</tr>
<tr class="alt">
  <td class="c1"><span class="ellipsis">Königlich Essen</span></td>
  <td class="c2"><span class="ellipsis">Philip Cramer</span></td>
  <td class="c3"><span class="ellipsis">Germany</span></td>
</tr>
</table>
</div>​

CSS:

table{table-layout:fixed;width:100%;border:solid gray 1px;}
/*table{table-layout:auto;width:100%;border:solid gray 1px;}*/
tr{}
td{}
td.c1{width:100%;}
td.c2{width:6em;}
td.c3{width:4em;}

/* formatting the clipped output */
.ellipsis{display:block;overflow:hidden;white-space:nowrap;text-overflow: ellipsis;width:inherit;}

/* just for the test case */
div{display:block;width:90%;margin:1em;background-color:silver;}
span{padding:2px;width:inherit;}

I prepared a fiddle with that test case for you to play around:
http://jsfiddle.net/UgYFs/3/

When you decrease the windows width (or the width of the left bottom “Result” compartment) you can see how things work. This is the behaviour that I want.

The problem: (thus this question…)

This only works with a “table-layout:fixed;”. Makes some sense, however there are reasons that make this option unavailable: in the real application the tables rows are inserted dynamically. This does not work with a fixed layout, at least the optical result is quite different (which also makes sense). So if I like it or not, I think I have to go with a “table-style:table” (the default). You can switch to that in the CSS compartment by uncommenting the second line, thus changing the table-layout. You see that the behaviour changes.

My question:

Is there a way to combine both things:

  • to get the desired behaviour as described and demonstrated
  • to fill the table without a fixed layout (maybe switching the layout later) ?

Until now I failed to succeed. But I am just a bloody beginner in all this stylish web stuff…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:06:16+00:00Added an answer on June 12, 2026 at 12:06 pm

    Right, since no one had an idea I tried a different approach to what I was asking about were. I want to close this question, so I post the outcome, even if it is not a solution to what I asked here…

    I succeeded to modify the rest of the app such that the way the table is filed dynamically works even when table-layout: fixed; is set. This allows me to use standard css table rules to keep that single column flexible in width but still limited in length because the whole tables width can be derived from the container now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I could really use some help with files (images) download/save application process. I need
I could really use some help. I have a javascript / jquery slider below
We could really use some help with a hashset output question. We have the
I could really use some help with the following SQL Select statement scenario: I
i am trying to make a distributed application and could really use some help
I have a piece of code here that i really could use some help
I have just started learning python/matplotlib/basemap and could really use some help. How do
I could really, really, really use some help. I have looked everywhere on some
I could really use some help. I have the following two lines. <TD noWrap>Data:
I could really use some help with what I have a feeling will be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.