473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Three columns , two rows

Why won't the following code do as expected?
Like print Top Three on the top row and bottom three in the bottom row
in that order.

Thanks for any advice.

Kaushal

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<title>Title</title>
<style type="text/css">
div.container
{

width: 1100px;
border: 1px black solid;
margin-left: auto;
margin-right: auto;
}
div.inside
{
float: left;
}
div.top1
{
border: 1px black solid;
height: 100px;
width: 100px;
background-color: red;
float: left;
}
div.top2
{
border: 1px black solid;
height: 100px;
width: 100px;
background-color: green;
float: left;
}
div.top3
{
border: 1px black solid;
height: 100px;
width: 100px;
background-color: blue;
float: left;
clear: right;
}
div.bottom1
{
border: 1px black solid;
height: 100px;
width: 100px;
background-color: red;
float: left;
clear: left;

}
div.bottom2
{
border: 1px black solid;
height: 100px;
width: 100px;
background-color: green;
float: left;
}
div.bottom3
{
border: 1px black solid;
height: 100px;
width: 100px;
background-color: blue;
float: left;

}
</style>
</head>
<body>
<div class="container">
<div class="top1">
Top 1
</div>
<div class="top2">
Top 2
</div>
<div class="top3">
Top 3
</div>

<div class="bottom1">
Bottom 1
</div>
<div class="bottom2">
Bottom 2
</div>
<div class="bottom3">
Bottom 3
</div>

</div>
</body>
</html>
Apr 9 '07 #1
2 7938
Scripsit Kaushal Shah:
Why won't the following code do as expected?
Like print Top Three on the top row and bottom three in the bottom row
in that order.
On IE 7, the first three blocks and the last two blocks appear as one row,
and the fourth block below them. This is odd, and it appears to be a browser
bug. On Firefox, I get the desired table-like appearance.

In practice, if you need something really table-like, maybe you _have_ a
table and could use table markup in CSS. Otherwise, you might find
positioning easier to use consistently (setting position: relative for the
outer div and then positioning the inner div elements "absolutely"
relatively to the outer div).

Anyway, the bug seems to disappear in IE 7 if I add an artificial empty div
element after the third div element:
<div style="clear: left"></div>

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Apr 9 '07 #2
Jukka K. Korpela wrote:
Scripsit Kaushal Shah:
>Why won't the following code do as expected?
Like print Top Three on the top row and bottom three in the bottom row
in that order.

On IE 7, the first three blocks and the last two blocks appear as one
row, and the fourth block below them. This is odd, and it appears to be
a browser bug. On Firefox, I get the desired table-like appearance.

In practice, if you need something really table-like, maybe you _have_ a
table and could use table markup in CSS. Otherwise, you might find
positioning easier to use consistently (setting position: relative for
the outer div and then positioning the inner div elements "absolutely"
relatively to the outer div).

Anyway, the bug seems to disappear in IE 7 if I add an artificial empty
div element after the third div element:
<div style="clear: left"></div>

Ok Thanks for the information.
Apr 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Emilio | last post by:
Hello everyone. I hope someone can help me with this. I have 3 columns called EMPLOYEE_TEST, TEST_QA and EMPLOYEE_TEST_ANSWER. The TEST_QA table contains the following: TEST_QA_ID |...
2
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
4
by: Mortar | last post by:
i need a datagrid with 2 header columns. The top one might have 1 column spanning 5 columns of the header row below it. what is the best way to do this? Could i have 2 datatables...1 filling the...
4
by: Hexman | last post by:
In my application I retrieve about 100 rows from an Access DB to perform a daily process. A sql query statement selects, joins, and orders the dataset. Now, out of the dataset, the user may need...
68
by: Martin Joergensen | last post by:
Hi, I have some files which has the following content: 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0
0
by: sysmanint1 | last post by:
I am a total neophyte at Visual Basic but found the following post and reply from Clint concerning a dynamic range. Also, have never "posted" to a discussion I have made a macro that works on...
7
by: lethek39 | last post by:
Hey I have been trying to figure out how to sum rows and columns in a matrix square. I also have been trying to get the program to list the numbers of the diagonal in the matrix. So far this is the...
0
by: anureddy | last post by:
help me how to add datagridview columns to another table,using windowsapplications. and set the displaymember and value member datagridviewcomboboxcolumn. i used this below code but that not...
5
by: zaankanter | last post by:
Generaly a table wil order data in a two dimensional way, as rows of data in a predefined number of columns. Re-thinking an already tackled problem (but not so very-well-tackled: thus the...
0
by: Radu | last post by:
Hi. I'm trying to read the structure of some Excel 2000 file that the user is expected to upload. The file must be an excel file (solved) and it must contain a column named "PIN". That's all. Now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.