Solved

Simulating table-like layout using divs

Posted on 2008-10-11
3
545 Views
Last Modified: 2012-08-13
I have the following user control markup, that I want to display like the layout in the attached file, however I have serious issues with aligning the divs. I'd appreciate your help.

<div id="divSection" class="ifs-section">
    <div id="divSectionSeparator" class="ifs-sectionTopSeparator">
    </div>
    <div id="divSectionBody" class="ifs-sectionBody">
        <div id="divSectionHint" class="ifs-sectionHint">
            <div id="divSectionTitle" class="ifs-sectionTitle">
                <asp:PlaceHolder ID="PlaceHolderTitle" runat="server">
                    <asp:Literal ID="LiteralTitle" runat="server" />
                </asp:PlaceHolder>
            </div>
            <div id="divSectionDescription" class="ifs-sectionDescription">
                <asp:PlaceHolder ID="PlaceHolderDescription" runat="server">
                    <asp:Literal ID="LiteralDescription" runat="server" />
                </asp:PlaceHolder>
            </div>
        </div>
    </div>
    <div id="divSectionControl" class="ifs-sectionControls">
        <asp:PlaceHolder ID="PlaceHolderControls" runat="server">
        </asp:PlaceHolder>
    </div>
</div>
 
.ifs-section
{
    width:auto;
}
 
.ifs-sectionTopSeparator
{
    background-color:#008080;
    height: 1px;
}
 
.ifs-sectionBody
{
    width: inherit;
}
 
.ifs-sectionHint
{
    width: 40%;
    padding: 2px 2px 2px 2px;
}
 
.ifs-sectionTitle
{
    vertical-align: top;
    color: Black;
    font-family: arial;
    font-size: 12pt;
    font-weight: bold;
    text-align: left;
    border-bottom: 10px;
}
 
.ifs-sectionDescription
{
    vertical-align: bottom;
    color: Black;
    font-family: verdana;
    font-size:8pt;
    text-align: left;
    border-bottom: 10px;
}
 
.ifs-sectionControls
{
    background-color: #B0E0E6;
    padding: 2px 2px 2px 2px;
    min-width: 300px;
    min-height: 100px;
}

Open in new window

layouts.png
0
Comment
Question by:iulianchira
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
scrathcyboy earned 500 total points
ID: 22696387
If just baffles me why people with working table layouts feel compelled to put themselves through the hassle of trying to emulate the same functionality in DIVs.  What does it prove?   I can get a table layout to render perfectly X browser in a matter of an hour, but I see people coming to EE asking for help, and they have spent months trying to get a DIV layout to emulate the table layout they had that worked perfectly.  Do it if you have the inclination.  But expect a lot of problems getting everything to work X browser perfectly.

Feel free to ignore my comment since it is not helping you with the challenge you have taken on.
0
 

Author Comment

by:iulianchira
ID: 22696817
That's exactly what I ended up doing. I've kept only the inner divs (to be able to set min-width for cell) and replaced the rest with table elements. I did manage to arrange the divs as I wanted (IE7/8, Firefox), but couldn't get the structure to render properly in IE6.
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 22698362
"couldn't get the structure to render properly in IE6"

That is very typical.  It is a real battle to get a sophisticated layout like yours appears to be, given the older browsers like IE6 still around, and the NEW CSS specs not being instituted by all browsers yet.  I would guess it will take another 1-2 years before layout with DIVs and spans is a snap, I think it will need CSS4, because even the version 3 specs don't make it easy.  Sure it can be done, it is just not as easy as tables yet -- and hopefully will be, but who knows.

 I think when IE6 is dead, and IE8 or 9 is out, then you will be looking at the right time to revisit your design, and whip it off with shadows, fades, rounded edge effects, and all kinds of sophisticated jazz that is not really possible today --  90 degree rotated text being a great example.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question