473,624 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need to borrow your brain for large <table>

RC
Dear Dudes,

I post this in multiple groups for opening brain storm.

Sometime I need to query the data from database server then display them
into user's browser in HTML <table>. But if the <table> is very LARGE,
let's say 20 columns, hundreds rows. Usually you have header <th> tags
on 1st (top) row and 1st (most left) column. For a such LARGE <table>.
you really want:

1) When scroll the vertical scroll bar, you want the top row header
<thead> stay in the same position, the rest of rows are move up/down
(this will include the most left column).

I am success doing this part.

2) When you scroll the horizontal scroll bar, you want the most left
column stay in the same position, the rest of columns are move
left/right (this will include the top header row).

I don't know how to do this part, need to borrow your brain for help!
Thank Q very much in advance!

You can check out my test page from

http://amazon.nws.noaa.gov/hads/test/15C2C420.html

Here is basicly what I do

<html><title>Sc rollable Table</title><head>
<script language="JavaS cript">
var preRow = null;
function changeRow(thisR ow) {
if (preRow != null)
preRow.bgColor = "white";
thisRow.bgColor = "cyan";
preRow = thisRow;
}
</script>
<style type="text/css">
tbody { max-height: 30em; overflow: auto; }
th { background-color: lightgrey; }
th.left { background-color: cyan; }
</style></head><body>

<table border=1 width="100%">

<thead>
<tr><th class="left">co l1,row1</th>..... <th>coln,row1 </th></tr>
</thead>

<tbody>
<tr onClick="change Row(this)">
<th class="left">co l1,row2</th><td>col2,row 2</td>......
<td>coln,row2 </td></tr>
.....
.....
<tr onClick="change Row(this)">
<th class="left">co l1,rown</th><td>col2,row n</td>......
<td>coln,rown </td></tr>

</tbody>
</table></body></html>

I prefer doing this by CSS, HTML/DHTML/XDHTML, XML and little
Javascript. Java <applet> Swing JTable will be last resource,
because user has different browser, some not support Java 1.x.
And load large data into *.jar for <applet> will take time.

I did some Google search, I found two sites doing this by JavaScript.
But I prefer not to load huge file, run the JavaScript on client site.
I prefer load plain text HTML from server. Of cource, I'll keep mind
open use JavaScript grid as 2nd choice.

Here are those two good sites:

http://www.activewidgets.com/

Above site the most left column is label in sequence row number, like
preadsheet. Not very good.

http://www.theopensourcery.com/jsgrids.htm
Dec 6 '05 #1
3 1680

"RC" <ra**********@n ospam.noaa.gov> wrote in message
news:dn******** **@news.nems.no aa.gov...
Dear Dudes,

I post this in multiple groups for opening brain storm.
Big mistake! It is bad Usenet netiquette to crosspost to many different
newsgroups on the same problem, especially such diverse ones. The netiquette
people are going to be all over you....
Sometime I need to query the data from database server then display them
into user's browser in HTML <table>. But if the <table> is very LARGE,
let's say 20 columns, hundreds rows. Usually you have header <th> tags
on 1st (top) row and 1st (most left) column. For a such LARGE <table>.
you really want:

1) When scroll the vertical scroll bar, you want the top row header
<thead> stay in the same position, the rest of rows are move up/down
(this will include the most left column).

I am success doing this part.

2) When you scroll the horizontal scroll bar, you want the most left
column stay in the same position, the rest of columns are move
left/right (this will include the top header row).

I don't know how to do this part, need to borrow your brain for help!
Thank Q very much in advance!

You can check out my test page from

http://amazon.nws.noaa.gov/hads/test/15C2C420.html

Here is basicly what I do

<html><title>Sc rollable Table</title><head>
<script language="JavaS cript">
var preRow = null;
function changeRow(thisR ow) {
if (preRow != null)
preRow.bgColor = "white";
thisRow.bgColor = "cyan";
preRow = thisRow;
}
</script>
<style type="text/css">
tbody { max-height: 30em; overflow: auto; }
th { background-color: lightgrey; }
th.left { background-color: cyan; }
</style></head><body>

<table border=1 width="100%">

<thead>
<tr><th class="left">co l1,row1</th>..... <th>coln,row1 </th></tr>
</thead>

<tbody>
<tr onClick="change Row(this)">
<th class="left">co l1,row2</th><td>col2,row 2</td>......
<td>coln,row2 </td></tr>
....
....
<tr onClick="change Row(this)">
<th class="left">co l1,rown</th><td>col2,row n</td>......
<td>coln,rown </td></tr>

</tbody>
</table></body></html>

I prefer doing this by CSS, HTML/DHTML/XDHTML, XML and little
Javascript. Java <applet> Swing JTable will be last resource,
because user has different browser, some not support Java 1.x.
Then I strongly suggest that you keep your problem out of the
comp.lang.java. * newsgroups until you have thoroughly explored CSS,
HTML/DHTML/XDHTML, XML and Javascript to see if they can help you with your
problem.

I certainly don't want to be bothered trying to show you how this problem
can be solved via Java if you don't want to use Java in the first place.
And load large data into *.jar for <applet> will take time.
You don't normally load data of the kind you are describing into jars. It is
much more common to access data from databases like MySQL or DB2 via JDBC,
rather than storing the data in jars. After all, the data will presumably be
changing regularly so you will always want to access the "latest and
greatest" data; the best place to do that is in a database.
I did some Google search, I found two sites doing this by JavaScript.
But I prefer not to load huge file, run the JavaScript on client site.
I prefer load plain text HTML from server. Of cource, I'll keep mind
open use JavaScript grid as 2nd choice.

Here are those two good sites:

http://www.activewidgets.com/

Above site the most left column is label in sequence row number, like
preadsheet. Not very good.

http://www.theopensourcery.com/jsgrids.htm


I am relatively sure that the behaviour you want can be accomplished fairly
easily in Java via JTables but I am not going to waste time describing this
if you don't want to use Java in the first place.

Why don't you try the other approaches first, then come back to
comp.lang.java. gui if the other approaches don't work to your satisfaction?

Rhino
Dec 6 '05 #2
On Tue, 06 Dec 2005 10:43:26 -0500, RC <ra**********@n ospam.noaa.gov>
wrote, quoted or indirectly quoted someone who said :

Sometime I need to query the data from database server then display them
into user's browser in HTML <table>. But if the <table> is very LARGE,
let's say 20 columns, hundreds rows. Usually you have header <th> tags
on 1st (top) row and 1st (most left) column. For a such LARGE <table>.
you really want:


There are ways of doing that with CSS/HTML but they are pretty flaky.
I tried many of the hacks and gave up because, every browser behaves a
different way.

Take the bull by the horns and put an Applet in JAWS app in your
client with a JTable and a TableModel. Then you can make it do tricks
like a circus pony.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Dec 6 '05 #3
Tex
> You can check out my test page from
http://amazon.nws.noaa.gov/hads/test/15C2C420.html


Consider a JVM 1.1 Applet as virtually everyone has that, and then
your can build an application rather than a web page. In your example
your data appears to include:
1. Temp: Readings, Avg, Max, Min
2. Wind Speed: Readings, Hr Avg, Daily Avg, Peak
3. Wind Direction: Readings, Hr Avg, Daily Avg, @ Peak
etc.

With an applet you can download the readings and build all else
on the client machine and present it anyway you want including
scrollable tables and graphs, and the graphs can be scrolled
and the scale changed. You could add movable brackets to
a graph so user could get Avg, Min, Max, etc over any period
desired.

And the applet can download very compact data. As one example,
I had several tables which as a text file was 85K, as a binary file
was 15K which packed into a Jar as 5K.

You could pack the readings into binary and then to zip files by say
month, or quarter, or whatever is best for the application, and an
applet can spawn threads to download additional files while
working on initial data.

A TMY hourly weather file for a given city for a while year is approx
146K in binary and 72K as zip. An applet can unpack zip files and
can decode binary, e.g. TMY weather files.

So, your initial request was help building same-old, same-old,
web page w/ a little jazz via a scrollable table. With applets you
can consider building an application, and they are much more
valuable to your users.

--tex

Dec 7 '05 #4

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

Similar topics

8
4656
by: bearclaws | last post by:
I am looping through a list of categories and want to display the list horizontally (instead of vertically). I want to create a single row with 4 list items in each cell of the row. I thought this would work but I get this error: "End tag 'xsl:if' does not match the start tag 'ul'." Any thoughts?
3
84596
by: Paul Thompson | last post by:
When I put a <div ...> inside a <table> specification, functionality is not there. When I put the <table> inside the <div> everything works. Why is that?
61
24454
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will 'stretch'</td> <td valign="top" width="300">some data that won't 'stetch'</td> </tr> </table>
19
17411
by: CMAR | last post by:
I have the following markup. The problem is that the browser, e.g., IE6, inserts several lines of blank space between the <div> and the following table. Is there a way to minimize that vertical spacing? Thanks, CMA <div class="vlgray">Condition</div> <table cellpadding="0" cellspacing="0">
10
26092
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not null references another, FK_LASTLYOID bigint not null references lastly, unique (FK_OTHEROID,FK_ANOTHEROID))
0
1304
by: timnels | last post by:
I've got a bizzare issue where I have an XML file to load into a data set like: <conversion> <table name="parent"> <table name="child"> </table> </table> <table name="another parent"> ....
7
1620
by: RC | last post by:
Dear Dudes, I post this in multiple groups for opening brain storm. Sometime I need to query the data from database server then display them into user's browser in HTML <table>. But if the <table> is very LARGE, let's say 20 columns, hundreds rows. Usually you have header <th> tags on 1st (top) row and 1st (most left) column. For a such LARGE <table>. you really want:
1
2219
by: prefersgolfing | last post by:
I'm not using Master Pages, yet I'd like to display the contents of an HTML page within a <table><tr><td> on a .aspx. I have a lengthy guide already paginated in html. I'd like to embed the pages "as is" in the new 2.0 app without using Master Pages or creating new ..aspx's. I'm looking for the quickest way to the finish line. Any suggestions would be welcomed. Thanks.
2
2492
by: BD | last post by:
Hi, all. My background is more Oracle than db2. My skills at SQL tuning are quite limited. I'm running 8.2 on Windows. I'm tasked with some SQL optimization, and am doing some explain plans on various queries.
0
8231
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8168
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8672
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8614
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8330
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8471
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4075
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.