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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:18:06+00:00 2026-06-07T07:18:06+00:00

My boss wants me to stop using CSS layouts and start using table layouts.

  • 0

My boss wants me to stop using CSS layouts and start using table layouts. A major factor in this is the desirable behavior of tables in horizontally positioned, fluid layouts. See this example:

  • http://jsfiddle.net/CXSS2/2/

If you slide the width of the HTML panel narrower, you will see that the table (the first one) has several convenient qualities:

  1. Automatically finds a good place to split the two cells, giving the cell with more content a larger percentage of the available width.
  2. Fills all of the available width 100%.
  3. When deciding which of the cells to wrap, it does so in the way most efficient with regards to vertical space.
  4. Keeps the two cells aligned horizontally no matter what.

Example A does not have quality 1. (You have to update the ratio by hand if the content size changes.)

Example B does not have quality 1 or 3. (Static 50% is less than ideal but could work. However, it breaks on to 3 lines while the table is still only 2 lines tall.)

Example C does not have quality 2 or 4. (I can see ways to fake quality 2 with this one, but clearing down to the next line is totally a deal breaker.)

Example D does not have quality 1 or 4. (Technically it has 1, but the huge gap in between is not practical. Also, left/right floating on the same line doesn’t work well in some browsers.)

Since the data is not semantically tabular, I really want to avoid using tables. But my boss pays me, so I need to go with what he says or find a better solution. Is there a way to do this using semantic markup and CSS?

  • 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-07T07:18:07+00:00Added an answer on June 7, 2026 at 7:18 am

    Updated: For all browsers > ie7 you can use display: table, table-row, table-cell. the jQuery code will target ie7 and then replace the div’s with appropriate table elements.

    If this is the only problem you’ve run into so far, you shouldn’t install some goofy grid system just to fix this. That’s overkill and a waste of time.

    http://jsfiddle.net/CoryDanielson/yuNTX/

    sample html

    <div class="table width100pct">  <!-- .table should have NO style. just 'display: table' -->
        <div class="tr">
            <div class="td"></div>
            <div class="td"></div>
        </div>
    </div>​
    <!-- class="table, tr, td" is ONLY for changing display: table, table-row and table-cell.
    you SHOULD NOT include any styles inside of these CSS selectors. These classes will 
    be removed when the divs are transformed into <table>, <tr>, <td>
    -->
    
    //conditionally load the javascript patches for ie7
    <!--[if IE 7]><script src="/js/IE7fixes.js"></script><![endif]-->
    

    IE7fixes.js

    $(document).ready(function(){
      //comment out the if statement to check functionality without ie7    
      if ($.browser.msie && $.browser.version == 7) {
          $('html').addClass('ie7') //<html class="ie7">.. like modernizr
          var elem, elemClass    
          $('div.table').each(function(i, elem) {
              elem = $(elem)
              elemClass = elem.removeClass('table').attr('class') || ''
              elem.wrapInner("<table class='" + elemClass + "' />").children().unwrap()
          })
          $('div.tr').each(function(i, elem) {
              elem = $(elem)
              elemClass = elem.removeClass('tr').attr('class') || ''
              elem.wrapInner("<tr class='" + elemClass + "' />").children().unwrap()
          })  
          $('div.td').each(function(i, elem) {
              elem = $(elem)
              elemClass = elem.removeClass('td').attr('class') || ''
              elem.wrapInner("<td class='" + elemClass + "' />").children().unwrap()
          })
      }                    
    });​
    

    You should structure your CSS similar to mine

    required css

    table, div.table { width: 100%; }
    tr, div.tr { vertical-align: top; }
    /* the following 3 classes will be dropped when transformed in ie7
       but that won't matter because they'll fall back to <table><td><tr>
     */
    div.table { display: table; } /* NO STYLES HERE */
    div.tr { display: table-row; } /* NO STYLES HERE */
    div.td { display: table-cell; } /* NO STYLES HERE */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My boss wants me to set up an archiving mechanism such that a table
I currently have 26 tables in a MYSQL database. My boss wants me to
This is driving me insane: I'm an intern: my boss wants me to use
My boss wants me to encrypt some information used during data transfer. The individual
My boss wants me to develop some apps and make them appear on the
My boss wants us to use subversion for our MS Word documentation. The idea
Possible Duplicate: What is the best Twitter API wrapper/library for .NET? My boss wants
My boss is interested in using MKS Integrity for bug tracking, feature requests, Wiki
I have a start and stop button. I want to be able to start
My boss wants to distribute the application for a specific client, whose number of

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.