473,395 Members | 1,379 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,395 software developers and data experts.

Positioning HTML tables

Hi,

I have a group of 5 tables laid out of the web page. 2 go on the left
side and 3 on the right. These tables retrieve data from the database
so the number of records (rows) returned varies.

So the problem I am having at the moment is that if the table gets
longer by one or two rows, all my alignment goes of out whack for the
other tables. Is there a way for example to place table #2 right after
table#1 ends?

Table #1 Table #3

Table #4
Table #2
Table #5

Oct 11 '06 #1
5 1858
al******@gmail.com wrote:
Hi,

I have a group of 5 tables laid out of the web page. 2 go on the left
side and 3 on the right. These tables retrieve data from the database
so the number of records (rows) returned varies.

So the problem I am having at the moment is that if the table gets
longer by one or two rows, all my alignment goes of out whack for the
other tables. Is there a way for example to place table #2 right after
table#1 ends?

Table #1 Table #3

Table #4
Table #2
Table #5
How can anyone tell why this is happening if you're keeping the code
that's causing it a secret?
Oct 11 '06 #2
The code is no secret....its just lengthy so I chose not to include it.
Here it is:

....
<script language="Javascript"
src="/shared/javascript/validate.js"></script>
<script language="Javascript"
src="/shared/javascript/validation.js"></script>
<STYLE type="text/css">
div.RightTable1 {POSITION: relative; left: 10px; top: -1895px}
div.RightTable2 {POSITION: relative; left: 10px; top: -2900px}
div.RightTable3 {POSITION: relative; left: 10px; top: -2890px}
div.LeftTable1 {POSITION: relative; top: -1520px}
</style>
</head>
<%
.....

Sub Main()
DisplaySignups
DisplayMonthlyAccess
DisplayCountByState
DisplayCountByIndustry
DisplayCountByStateInd
End Sub

Sub DisplaySignups
Dim monthNo, yearNo, countSignups
Dim rsSignups : Set rsSignups = SummaryInfo("SIGNUP BY MONTH")

If Not rsSignups.EOF AND Not rsSignups.BOF Then
xmlSummary = xmlSummary & "<sign-ups>"
rsSignups.MoveFirst
Do While Not rsSignups.EOF
monthNo =
ConvertNullToString(ReplaceSpecialCharacters(rsSig nups.Fields("month_no")))
yearNo =
ConvertNullToString(ReplaceSpecialCharacters(rsSig nups.Fields("year_no")))
countSignups =
ConvertNullToString(ReplaceSpecialCharacters(rsSig nups.Fields("count")))
xmlSummary = xmlSummary & "<sign-up><count>" & countSignups &
"</count><month>" & monthNo & "</month><year>" & yearNo &
"</year></sign-up>"
rsSignups.MoveNext
Loop

xmlSummary = xmlSummary & "</sign-ups>"
rsSignups.Close
End If

Set rsSignups = Nothing

If strXSLFile <"" Then
strHTML = TransformXML(xmlSummary, strXSLFile)
If strHTML <"" Then
FrameMe "User Sign Up's via eFinance-it by Month", strHTML, "50%"
End If
End If

xmlSummary=""
End Sub

Sub DisplayMonthlyAccess
Dim appName, monthNo, yearNo, visitorCount
Dim rsAccess : Set rsAccess = SummaryInfo("ACCESS BY MONTH")

If Not rsAccess.EOF AND Not rsAccess.BOF Then
xmlSummary = xmlSummary & "<monthly-access>"
rsAccess.MoveFirst
Do While Not rsAccess.EOF
appName =
ConvertNullToString(ReplaceSpecialCharacters(rsAcc ess.Fields("app_name")))
monthNo =
ConvertNullToString(ReplaceSpecialCharacters(rsAcc ess.Fields("month_no")))
yearNo =
ConvertNullToString(ReplaceSpecialCharacters(rsAcc ess.Fields("year_no")))
visitorCount =
ConvertNullToString(ReplaceSpecialCharacters(rsAcc ess.Fields("visitor_cnt")))
xmlSummary = xmlSummary & "<month-access><app-name>" & appName &
"</app-name><month>" & monthNo & "</month><year>" & yearNo &
"</year><count>" & visitorCount & "</count></month-access>"
rsAccess.MoveNext
Loop

xmlSummary = xmlSummary & "</monthly-access>"
rsAccess.Close
End If

Set rsAccess = Nothing

If strXSLFile <"" Then
strHTML = TransformXML(xmlSummary, strXSLFile)
If strHTML <"" Then%>
<div align="right" class="RightTable1" >
<%FrameMeWithNote "Registered eFinance-it User Access by Month",
"<font color=""red"">Excludes Jacksonville</font>", strHTML, "50%"
End If
End If%>
</div>
<%
xmlSummary=""
End Sub

Sub DisplayCountByState
Dim stateName, country, count
Dim rsCount : Set rsCount = SummaryInfo("COUNT BY STATE")

If Not rsCount.EOF AND Not rsCount.BOF Then
xmlSummary = xmlSummary & "<state-count>"
rsCount.MoveFirst
Do While Not rsCount.EOF
stateName =
ConvertNullToString(ReplaceSpecialCharacters(rsCou nt.Fields("state_name")))
country =
ConvertNullToString(ReplaceSpecialCharacters(rsCou nt.Fields("country")))
count =
ConvertNullToString(ReplaceSpecialCharacters(rsCou nt.Fields("client_cnt")))
xmlSummary = xmlSummary & "<state><state-name>" & stateName &
"</state-name><country>" & country & "</country><count>" & count &
"</count></state>"
rsCount.MoveNext
Loop

xmlSummary = xmlSummary & "</state-count>"
rsCount.Close
End If

Set rsCount = Nothing

If strXSLFile <"" Then
strHTML = TransformXML(xmlSummary, strXSLFile)
If strHTML <"" Then%>
<div class="LeftTable1">
<%FrameMe "Registered eFinance-it User Count By State", strHTML,
"50%"
End If
End If%>
</div>
<%xmlSummary=""
End Sub

Sub DisplayCountByIndustry
Dim industryName, count
Dim rsCount : Set rsCount = SummaryInfo("COUNT BY IND")

If Not rsCount.EOF AND Not rsCount.BOF Then
xmlSummary = xmlSummary & "<industry-count>"
rsCount.MoveFirst
Do While Not rsCount.EOF
industryName =
ConvertNullToString(ReplaceSpecialCharacters(rsCou nt.Fields("SIC_Class_desc")))
count =
ConvertNullToString(ReplaceSpecialCharacters(rsCou nt.Fields("client_cnt")))
xmlSummary = xmlSummary & "<industry><industry-name>" & industryName
& "</industry-name><count>" & count & "</count></industry>"
rsCount.MoveNext
Loop

xmlSummary = xmlSummary & "</industry-count>"
rsCount.Close
End If

Set rsCount = Nothing

If strXSLFile <"" Then
strHTML = TransformXML(xmlSummary, strXSLFile)
If strHTML <"" Then%>
<div align="right" class="RightTable2">
<%FrameMe "Registered eFinance-it User Count By Industry", strHTML,
"50%"
End If
End If%>
</div>
<%xmlSummary=""
End Sub

Sub DisplayCountByStateInd
Dim industryName, count, stateName
Dim rsCount : Set rsCount = SummaryInfo("COUNT BY ST IND")

If Not rsCount.EOF AND Not rsCount.BOF Then
xmlSummary = xmlSummary & "<stateind-count>"
rsCount.MoveFirst
Do While Not rsCount.EOF
stateName =
ConvertNullToString(ReplaceSpecialCharacters(rsCou nt.Fields("client_state")))
industryName =
ConvertNullToString(ReplaceSpecialCharacters(rsCou nt.Fields("SIC_Class_desc")))
count =
ConvertNullToString(ReplaceSpecialCharacters(rsCou nt.Fields("client_cnt")))
xmlSummary = xmlSummary & "<state-ind><state-name>" & stateName &
"</state-name><industry-name>" & industryName &
"</industry-name><count>" & count & "</count></state-ind>"
rsCount.MoveNext
Loop

xmlSummary = xmlSummary & "</stateind-count>"
rsCount.Close
End If

Set rsCount = Nothing

If strXSLFile <"" Then
strHTML = TransformXML(xmlSummary, strXSLFile)
If strHTML <"" Then%>
<div align="right" class="RightTable3">
<%FrameMe "Registered eFinance-it User Count By State/Industry",
strHTML, "50%"
End If
End If%>
</div>
<%xmlSummary=""
End Sub
Function SummaryInfo(SubDetailTx)
Const reRecordset = 1
Dim SPID : SPID = ""
Dim RetXML : RetXML = ""
Dim oXMLRetrieve, rsSummary, XML_SP

'check for SubDetailTx
Select Case UCase(SubDetailTx)
Case "SIGNUP BY MONTH": SPID = SIGNUP_SPID
Case "COUNT BY STATE": SPID = COUNT_ST_SPID
Case "COUNT BY IND": SPID = COUNT_IND_SPID
Case "COUNT BY ST IND": SPID = COUNT_ST_IND_SPID
Case "ACCESS BY MONTH": SPID = ACCESS_SPID
Case Else RetXML = ""
End Select

XML_SP = XML_SP & "<sp name='"& SPID & "' db-code='33'>"
XML_SP = XML_SP & "</sp>"

Set oXMLRetrieve = Server.Createobject("ReportEngine.Retrieval")
Set rsSummary = oXMLRetrieve.ExecuteQuery(reRecordSet,XML_SP)

Set SummaryInfo = rsSummary
End Function
Harlan Messinger wrote:
al******@gmail.com wrote:
Hi,

I have a group of 5 tables laid out of the web page. 2 go on the left
side and 3 on the right. These tables retrieve data from the database
so the number of records (rows) returned varies.

So the problem I am having at the moment is that if the table gets
longer by one or two rows, all my alignment goes of out whack for the
other tables. Is there a way for example to place table #2 right after
table#1 ends?

Table #1 Table #3

Table #4
Table #2
Table #5

How can anyone tell why this is happening if you're keeping the code
that's causing it a secret?
Oct 11 '06 #3
al******@gmail.com schrieb:
Harlan Messinger wrote:
[...]
>How can anyone tell why this is happening if you're keeping the code
that's causing it a secret?
The code is no secret....its just lengthy so I chose not to include it.
Here it is:
[snip code]

1. You misunderstood it - your ASP (or whatever it is) code is not
helpful, but the HTML and CSS code of the page generated.

2. In Usenet you are required to avoid top-posting - leave the parts of
the original message that you reply to, and place your reply below it.

3. From the style part of the code you submitted I see that you
misunderstand the concept of relative positioning. Relative positioning
makes a container the reference for absolute positioning of the
contained elements:

<div class="container">
<div class="contents">This is my contents</div>
</div>

CSS:
..container { position:relative; }
..contents { position:absolute; top:...... }

So the contents element is positioned relatively to the container
element rather than to the body.

Anyway generally I don't think that absolute positioning is a way to go
with your tables, as you don't know the heights (as you mentioned
yourself in the original posting). If you need 2 columns you might be
successful with floated divs, such as:

<div id="left_container">
<table>...</table>
<table>...</table>
</div>
<div id="right_container">
<table>...</table>
<table>...</table>
</div>

CSS:
#left_container, #right_container { float:left; }

If you google for CSS column layouts you will find lots of info about this.

HTH
Markus
Oct 12 '06 #4
al******@gmail.com wrote:
[top-posting corrected]
Harlan Messinger wrote:
>al******@gmail.com wrote:
>>Hi,

I have a group of 5 tables laid out of the web page. 2 go on the left
side and 3 on the right. These tables retrieve data from the database
so the number of records (rows) returned varies.

So the problem I am having at the moment is that if the table gets
longer by one or two rows, all my alignment goes of out whack for the
other tables. Is there a way for example to place table #2 right after
table#1 ends?

Table #1 Table #3

Table #4
Table #2
Table #5
How can anyone tell why this is happening if you're keeping the code
that's causing it a secret?
The code is no secret....its just lengthy so I chose not to include it.
That's like calling the doctor and asking him to tell you over the phone
what to do about your sore throat without having you come in so he can
examine your throat, take your temperature, feel your glands, and draw
your blood, because that seems like a lot of trouble. Maybe so, but
without an examination he can't tell you anything.
Here it is:

...
<script language="Javascript"
src="/shared/javascript/validate.js"></script>
<script language="Javascript"
src="/shared/javascript/validation.js"></script>
<STYLE type="text/css">
div.RightTable1 {POSITION: relative; left: 10px; top: -1895px}
div.RightTable2 {POSITION: relative; left: 10px; top: -2900px}
div.RightTable3 {POSITION: relative; left: 10px; top: -2890px}
div.LeftTable1 {POSITION: relative; top: -1520px}
</style>
</head>
[...]
I don't know what you're trying to accomplish with the relative
positioning, but what you're saying is: take any DIV having class
LeftTable1 and reposition it 1520 pixels higher than it would be if you
weren't using relative positioning on *any* of the elements; and move
DIVs belonging to the other classes up the page similarly, as well as
moving them 10 pixels to the left of where they would otherwise be if
you weren't using relative positioning at all. As far as I know that's
exactly what's happening on your page, but I have no way to know because
I can't see your page, and because you haven't even provided the HTML,
only the ASP code that generates it, which is useless for figuring out
what the browser is doing.
Oct 12 '06 #5
I don't know what you're trying to accomplish with the relative
positioning, but what you're saying is: take any DIV having class
LeftTable1 and reposition it 1520 pixels higher than it would be if you
weren't using relative positioning on *any* of the elements; and move
DIVs belonging to the other classes up the page similarly, as well as
moving them 10 pixels to the left of where they would otherwise be if
you weren't using relative positioning at all. As far as I know that's
exactly what's happening on your page, but I have no way to know because
I can't see your page, and because you haven't even provided the HTML,
only the ASP code that generates it, which is useless for figuring out
what the browser is doing.
Thanks for your responses, I appreciate it. The HTML is in the XSL
file, but no worries I was able to figure it out with the help of the
comments that were already posted.

I tooked out the DIV classes and created these...

#left_container{float:left;margin: 0 0 5px 5px;}
#right_container{float:right;margin: 0 0 5px 5px;}

in the left container i put my 2 left tables (ie. <div
id="left_container"><table></table><table></table></div>)

in the right container i put the 3 right ones

and no other styling was necessary for positioning as each table
automatically goes after the one before it (no matter the
length)...which is exactly what I had wanted

Sorry for the confusion, I guess it would've made more sense to include
the HTML! :)

And sorry I can't provide u with a link to the page...its an intranet
site

Oct 12 '06 #6

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

Similar topics

36
by: Jack Hughes | last post by:
This argument has come up two or three times lately. We have a web standards document at our company that say "Use valid HTML 4; We don't recommend switching to DIV-based CSS-P for layout just...
1
by: RWC | last post by:
Hey Folks! I'm having trouble with an asp page. First off, I'm new to the html / asp world, but not to software development. I'd like to minimize or "normalize" the site, so I'm trying to use...
1
by: Charles Harrison Caudill | last post by:
with tables there is a clean and algorithmic way to organize things, but with css which is, once you get it working, much cleaner, I have to tweak and patch and hope and pray and curse before...
2
by: Rob R. Ainscough | last post by:
I'm slowly (very slowly) working my way thru the bizarre and sadistic world of control positioning in MultiViews (ASP 2.0). I came across this to help me explain (or attempt to anyway) why my web...
4
by: Richard | last post by:
Hi, I like a demo on layers posted at http://www.echoecho.com/csslayers.htm. It displays two text phrases in separate layers visually overlapped, first with one on top and the other beneath,...
4
by: TheCeej | last post by:
I'm sorry to post what is ultimately a myspace problem, but I'm sure I'd still be having this problem with any html/css document, so the answer would more than likely be able to help anyone out. I'm...
2
by: TheCruelPanda | last post by:
Hey there. My name is Rowan, and it's been three weeks since I last used tables for an HTML design. Okay, I'm rather new to CSS and I have a big positioning problem here. It might not be a...
20
by: mehstg1319 | last post by:
Hi there Not sure if anyone can help me, I am working on a site for my university, and am having a bit of trouble with css positioning. I am very new to css and do not know very much about it....
14
by: Fistro | last post by:
I'm trying to find a design that would allow me to build web pages without having to worry about compatibility issues (not too much, in any case,,,) I've came across this CSS layout technique:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.