Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to display horizontal rows

Posted on 2008-06-19
8
Medium Priority
?
780 Views
Last Modified: 2011-10-19
I want to display horizontal rows. Here is my problem description
I am getting rows from the database, Now I want to display values as horizontal rows, means 2 rows as a single row. Assme my record set values are
Row1
Row2
Row2
Row4
Row5
Row6
I want to display output as
Row1                  Row4
Row2                  Row5
Row3                  Row6

Assume my record set values are
Row1
Row2
Row2
Row4
Row5
I want to display output as
Row1                  Row4
Row2                  Row5
Row3                  
So I can save lot of space. Any help.

These record set values are dynamic it may return 10..40 rows based on the data
0
Comment
Question by:jyothsna1803
[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
  • 4
  • 3
8 Comments
 
LVL 14

Expert Comment

by:Ali Kayahan
ID: 21823507
<style type="text/css">
.pan{float:left;clear:both}
</style>

<div class="pan">Row1</div>
<div class="pan">Row2</div>
<div class="pan">Row3</div>
<div class="pan">Row4</div>
0
 

Author Comment

by:jyothsna1803
ID: 21826064
I am not sure exactly what are you talking about, I asked totally different thing.
0
 
LVL 43

Expert Comment

by:David S.
ID: 21828792
@jyothsna1803

How is this a JavaScript question?

It would be helpful to see an example of the data.


@ali_kayahan

Now how do you make the second column? ;)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 14

Expert Comment

by:Ali Kayahan
ID: 21829060
I just couldnt get the question ,
@Kravimir:
<style type="text/css">
.pan{float:left;}
</style>

<div class="pan">Row1<div class="pan">Row3</div></div>
<div class="pan">Row2<div class="pan">Row4</div></div>
0
 
LVL 14

Expert Comment

by:Ali Kayahan
ID: 21829105
@jyothsna1803: that what i understand from your question ;
<style type="text/css">
#col{width:200px;float:left}
#col .pan{float:left;width:100px}
</style>
<div id="col">
<div class="pan">Row1</div>
<div class="pan">Row5</div>
<div class="pan">Row2</div>
<div class="pan">Row6</div>
<div class="pan">Row3</div>
<div class="pan">Row7</div>
<div class="pan">Row4</div>
</div>
0
 

Author Comment

by:jyothsna1803
ID: 21831972
Query: select HospitalName  from Hospital
Result:
Lenox Hill Hospital
Burke Rehabilitation Hospital: Physician Referral Service
Bellevue Hospital
Hospital for Special Surgery
Rockefeller University Hospital
New York Presbyterian Hospital: Devereux Richard B MD
New York Presbyterian Hospital-New York Weill Cornell Medical CE: Cornell Medical
Manhattan Eye Ear & Throat Hospital: Children's Hearing Institute
St Vincent's Hospital

I want to display the result in horizontally 2 hospitals.

I am expecting the below result.

Lenox Hill Hospital      New York Presbyterian Hospital: Devereux Richard B MD
Burke Rehabilitation Hospital: Physician Referral Service      New York Presbyterian Hospital-New York Weill Cornell Medical CE: Cornell Medical
Bellevue Hospital      Manhattan Eye Ear & Throat Hospital: Children's Hearing Institute
Hospital for Special Surgery      St Vincent's Hospital
Rockefeller University Hospital      

I may add or delete the hospital any time, So my table should adjust the results accordingly.

Basically I want to divide the hospitals count by 2 and first set and second set I want to display side by side like above example.
Please help.
0
 

Author Comment

by:jyothsna1803
ID: 21831990
See the document for sample format.
Query.doc
0
 

Accepted Solution

by:
jyothsna1803 earned 0 total points
ID: 21848199
I wrote the below code and is working fine now.
<html>
<head>

<title>TEST</title>

<style type="text/css">

<!--

html,body {
margin: 0;
padding: 0;
}

table {
width: 100%;
height: 100%;
}

div#border{

text-align: center;
margin: 1 auto;
}

div#left {
      height: 20px;
      width: 20px;
      border: 2px solid #FF0000;
      float: left;
}
div#right {
      height: 20px;
      width: 20px;
      border: 2px solid #0000FF;
      float: left;
}

div#container {
text-align: left;
margin-left: auto;
margin-right: auto;
}
-->
</style>

</head>

<body>
<fieldset>
    <legend>
    <span class="MainSubHeading">Which of the following do you receive (check all that apply):</span>
    </legend>

<table width="100%">
<tr width = "100%">
<td width = "50%">
<div id="container"><input type="checkbox" name="chk" id="chk" value="Lenox Hill Hospital">Lenox Hill Hospital</a>
<div id="container"><input type="checkbox" name="chk" id="chk" value="Burke Rehabilitation Hospital: Physician Referral Service">Burke Rehabilitation Hospital: Physician Referral Service</a>
<div id="container"><input type="checkbox" name="chk" id="chk" value="Bellevue Hospital">Bellevue Hospital</a>
<div id="container"><input type="checkbox" name="chk" id="chk" value="Hospital for Special Surgery">Hospital for Special Surgery</a>
<div id="container"><input type="checkbox" name="chk" id="chk" value="Rockefeller University Hospital">Rockefeller University Hospital</a>

</td>
<td width = "50%">
<div id="container"><input type="checkbox" name="chk" id="chk" value="New York Presbyterian Hospital: Devereux Richard B MD">New York Presbyterian Hospital: Devereux Richard B MD</a>
<div id="container"><input type="checkbox" name="chk" id="chk" value="New York Presbyterian Hospital-New York Weill Cornell Medical CE: Cornell Medical">New York Presbyterian Hospital-New York Weill Cornell Medical CE: Cornell Medical</a>
<div id="container"><input type="checkbox" name="chk" id="chk" value="Manhattan Eye Ear & Throat Hospital: Children's Hearing Institute">Manhattan Eye Ear & Throat Hospital: Children's Hearing Institute</a>
<div id="container"><input type="checkbox" name="chk" id="chk" value="St Vincent's Hospital">St Vincent's Hospital</a>
 
 



</td>
</tr>
</table>
</fieldset>
</body>

</html>

0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

610 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