ASP.NET <DIV> CSS - Keep on one row

I have four Divs.  They are being used to display values in a table.  They are separating the values.  The issue I have is that depending on the users resolution the last Div wraps to the bottom under the other divs.  Is there a way to keep all the divs next to each other regardless of the screen resolution?

Thanks

.datagrid td 
{
    padding-left:   20px;
    padding-right:   20px;
    border-left:    none; 
    border-right:   none; 
    border-bottom:  none;
    border-top:     none;
    border-collapse: collapse;
	font-size:      x-small;
	font-family:    Arial, Helvetica, sans-serif;
}

.datagrid th 
{
    padding-left:   10px;
    padding-right:   5px;
    border-left:    none; 
    border-right:   none; 
    border-bottom:  solid; 
	font-size:      x-small;
	font-family:    Arial, Helvetica, sans-serif;
}

Open in new window


<div id="first">
            <asp:DataGrid ID="dgBen" Runat="server" AutoGenerateColumns="False" 
                CssClass="datagridben" DataKeyField="ben_id"
                HeaderStyle-Font-Underline="True" HeaderStyle-Font-Bold="true" 
	            HeaderStyle-Height="20" >
	            <Columns>
		            <mbrsc:RowSelectorColumn SelectionMode="Single" HeaderText="<br />" ></mbrsc:RowSelectorColumn>
	            </Columns>
	            <Columns>
		            <asp:BoundColumn DataField="checked" Visible="False"></asp:BoundColumn>
	            </Columns>
	            <Columns>
		            <asp:BoundColumn DataField="id" HeaderText="ID" Visible="False"></asp:BoundColumn>
	            </Columns>
	            <Columns>
		            <asp:BoundColumn DataField="description" HeaderText='Plan' ItemStyle-Height="25"></asp:BoundColumn>
	            </Columns>
            </asp:DataGrid>
    </div>
    <div id="second">
            <asp:DataGrid ID="dgFirst" Runat="server" AutoGenerateColumns="False" 
                CssClass="datagrid" DataKeyField="id"
                HeaderStyle-Font-Underline="True" HeaderStyle-Font-Bold="true" 
	            HeaderStyle-Height="20" >
	            <Columns>
		            <asp:BoundColumn DataField="id" HeaderText="ID" Visible="False"></asp:BoundColumn>
	            </Columns>
	            <Columns>
		            <asp:BoundColumn DataField="cost" HeaderText="EE" ItemStyle-HorizontalAlign="center" HeaderStyle-HorizontalAlign="center"
			            DataFormatString="{0:c}" Visible="true" ItemStyle-Height="25" ></asp:BoundColumn>
	            </Columns>
            </asp:DataGrid>
    </div>
    <div id="third">
            <asp:DataGrid ID="dgSecond" Runat="server" AutoGenerateColumns="False" 
                CssClass="datagrid" DataKeyField="id"
                HeaderStyle-Font-Underline="True" HeaderStyle-Font-Bold="true" 
	            HeaderStyle-Height="20" >
	            <Columns>
		            <asp:BoundColumn DataField="id" HeaderText="ID" Visible="False"></asp:BoundColumn>
	            </Columns>
	            <Columns>
		            <asp:BoundColumn DataField="costTWO" HeaderText="EE + 1" ItemStyle-HorizontalAlign="center" HeaderStyle-HorizontalAlign="center"
			            DataFormatString="{0:c}" Visible="True" ItemStyle-Height="25" ></asp:BoundColumn>
	            </Columns>
            </asp:DataGrid>
    </div>
    <div id="fourth">
            <asp:DataGrid ID="dgThird" Runat="server" AutoGenerateColumns="False" 
                CssClass="datagrid" DataKeyField="id"
                HeaderStyle-Font-Underline="True" HeaderStyle-Font-Bold="true" 
	            HeaderStyle-Height="20" >
	            <Columns>
		            <asp:BoundColumn DataField="id" HeaderText="ID" Visible="False"></asp:BoundColumn>
	            </Columns>
	            <Columns>
		            <asp:BoundColumn DataField="costECH" HeaderText="EE + C" ItemStyle-HorizontalAlign="center" HeaderStyle-HorizontalAlign="center"
			            DataFormatString="{0:c}" Visible="True" ItemStyle-Height="25" ></asp:BoundColumn>
	            </Columns>
            </asp:DataGrid>
    </div>

Open in new window

LVL 2
CipherISAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Russ SuterCommented:
You'd need to enclose the 4 DIVs inside another DIV and set the CSS with nowrap and inline-block characteristics. Here's a very simple example:

<html>
<body>
<style>

.row {
    float:left;
    border: 1px solid yellow;
    width: 100%;
    overflow: auto;
    white-space: nowrap;
}

.cell {
    display: inline-block;
    border: 1px solid red;
    width: 200px;
    height: 100px;
}
</style>

<div class="row">
    <div class="cell">a</div>
    <div class="cell">b</div>
    <div class="cell">c</div>
</div>


</body>
</html>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CipherISAuthor Commented:
I tried the solution and its not working.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.