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 717143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:22:44+00:00 2026-05-14T05:22:44+00:00

I have a 3 column layout using table-less design. <div id=main> <div id=left></div> <div

  • 0

I have a 3 column layout using table-less design.

<div id="main">

  <div id="left"></div>
  <div id="content"></div>
  <div id="right"></div>

</div>

The CSS:

#left {width: 200px;float:left;display:inline;}
#content {width: 600px;float:left;display:inline;padding: 0 10px;}
#right {width: 160px;float:left;display:inline;}

I am using a web application, and I can’t change the layout. By can’t change, I mean the div’s with left/content/right cannot be removed.

On some pages, both the left and right columns are completely empty. And I want the #content div to expand more than the 600px.

is this possible, without altering the HTML? What are my options?

Thanks allot!

  • 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-14T05:22:44+00:00Added an answer on May 14, 2026 at 5:22 am

    I’m not sure about doing this with pure CSS, but since jquery was tagged in the question I’ll assume that its fair game.

    Take the following for example. What we’re doing here is checking to see if the #left or #right divs are empty. If so, we increase the #content div’s width respectively.

    $(document).ready(function(){
        if($('#left').height() == 0){
            $('#content').width( $('#content').width() + $('#left').width());
        }
        if($('#right').height() == 0){
            $('#content').width( $('#content').width() + $('#right').width());
        }           
    });
    

    This script can probably be improved upon, as its counting on the idea that an empty div will have a height of zero. I thought about using the :empty psuedo selector, but this will fail if there is any white space inside the div.

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

Sidebar

Related Questions

I have a two column site layout that has the content of the left
I'm developing a 3-column website using a layout like this: <div id='left' style='left: 0;
I'm using Drupal 6 and have created 2 equal columns in layout.css In the
I have a two column layout: http://jsfiddle.net/KqQ42/1/ Now I would like that the left
I want to have a 2 column layout, and have the left column able
I have the age-old problem of a div wrapping a two-column layout. My sidebar
Each column has a fixed width of 200px with a 20px margin. The top-left
To accomplish this I have done this: <table style=width:100%;> <tr> <td style=width:50%;text-align: left;>left</td> <td
Stuck using a table layout like this below with a lot of content in
I want to make a two column layout using DIVs, where right column will

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.