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

  • SEARCH
  • Home
  • 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 1018829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:55:01+00:00 2026-05-16T10:55:01+00:00

I need to create the following layout: +——–+———————————-+———–+ | fixed | variable | variable

  • 0

I need to create the following layout:

+--------+----------------------------------+-----------+
|  fixed |  variable         | variable     |   fixed   |
|  width |   width - p2      |  width - p1  |   width   |
+--------+-------------------+--------------+-----------+

Where the two middle boxes, with their variable widths have the priority p1 > p2. The content in these two boxes will never result in two lines of text (vertically) as the p2 box will use elipsis when the text is too wide for the box.

More ascii art examples!

+--------+----------------------------------+-----------+
| <img/> | A person @ A Location     |Today |   Accept  |
+--------+----------------------------------+-----------+

+--------+----------------------------------+-----------+
| <img/> | A person @ A Location w...|Today |   Accept  |
+--------+----------------------------------+-----------+

+--------+----------------------------------+-----------+
| <img/> | A person @ A ...|Yesterday @ 3pm |   Accept  |
+--------+----------------------------------+-----------+

So you’ll see the “p2” box grows (there will be a maximum width) and the “p1” box shrinks to accomodate the width increase.

I really wish CSS permitted dimensions to be expressed as equations using jquery-esque traversal and css selectors! i.e.

.style {
   width: $(this).parent.width - $('other_div).width ;
}

I am completely amenable to having this layout done in tables if it is easier to accomplish, i.e. if it requires less/no per-browser tweaking.

Cheers,

mike

UPDATE Ideally I’d like this to not require any javascript.

  • 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-05-16T10:55:02+00:00Added an answer on May 16, 2026 at 10:55 am

    This uses only CSS. The classes are not used and only there to match the question.

        <div class="row">
            <span class="col1">...</span>
            <span style="display: inline-block; position: relative; width: 400px;">
                <span class="col2" style="display: inline-block; width: 400px; overflow: hidden;">123456789012345678901234567890123456789012345678901234567890</span>
                <span class="col3" style="display: inline-block; position: absolute; top: 0px; right: 0px; background-color: #fff;">Higher priority text.</span>
            </span>
            <span class="col4">...</span>
        </div>
    

    This doesn’t resize col2 but it will draw over it, so it might not be ideal. Also, it may need a between each row.

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

Sidebar

Related Questions

I have the following three arrays and need to create a new two-dimensional array
I need to create relationships for my entities, whereby I have the following scenario:
Hi I have the following interfaces that I need to create. Can you just
I have the following code. I need to create list separators before A elements,
I have the below view that I need to create. I have the following
I have created following layout.which has two relative layouts and one scrollview ,following code
I need to create a button programatically and have it centered on the layout,
I need to develop an android app that achieves the following: Create an activity
Following my previous question , I need to create a value consisting of a
In MySQL, I need to create a new table called users with the following

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.