473,804 Members | 3,194 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

always visible colunmn headers

In a spreadsheet you can arrange that column headers are always
visible no matter how much your scroll the table itself. What is the
best way to get this effect in CSS?. Does it require frames or is
there a better way?

--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/...s_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
Jul 21 '05 #1
15 9278
On Tue, 28 Jun 2005 02:15:06 GMT, Roedy Green <lo*****@mindpr od.com.invalid>
wrote:
In a spreadsheet you can arrange that column headers are always
visible no matter how much your scroll the table itself. What is the
best way to get this effect in CSS?. Does it require frames or is
there a better way?


Someone will offer a pure CSS way.

I use tables and do it this way:

#topBar { POSITION: fixed; POSITION: expression("abs olute");
TOP: 0em; TOP: expression(pars eInt(document.b ody.scrollTop +0));

<div id="topBar">
Frontal Lobe<sup>(R)</sup>&nbsp;&nbsp ;Home Page
</div>

( you can tinker with the "0" -- someone here worried about it )

See it working at:

http://masonc.home.netcom.com

Mason C
Jul 21 '05 #2
Roedy Green wrote:
In a spreadsheet you can arrange that column headers are always
visible no matter how much your scroll the table itself. What is the
best way to get this effect in CSS?. Does it require frames or is
there a better way?


<http://www.home.golden .net/~richterf/Michael/Special.html>
Requires a Gecko based browser to view properly (overflow:auto; applied
to tbody).

--
Gus
Jul 21 '05 #3
In article <Hq************ ********@golden .net>,
Gus Richter <gu********@net scape.net> wrote:
Roedy Green wrote:
In a spreadsheet you can arrange that column headers are always
visible no matter how much your scroll the table itself. What is the
best way to get this effect in CSS?. Does it require frames or is
there a better way?


<http://www.home.golden .net/~richterf/Michael/Special.html>
Requires a Gecko based browser to view properly (overflow:auto; applied
to tbody).


Any suggestion as to how to get rid of that stupid horizontal scrollbar?

--
= Eric Bustad, Norwegian bachelor programmer
Jul 21 '05 #4
Roedy Green wrote :
In a spreadsheet you can arrange that column headers are always
visible no matter how much your scroll the table itself. What is the
best way to get this effect in CSS?. Does it require frames or is
there a better way?

Cross-browser scrolling tbody:
http://www.gtalbot.org/HTMLJavascrip...lingTBody.html

Gérard
--
remove blah to email me
Jul 21 '05 #5
"Roedy Green" wrote :
In a spreadsheet you can arrange that column headers are always
visible no matter how much you scroll the table itself. What is the
best way to get this effect in CSS?. Does it require frames or is
there a better way?


Assuming your purpose is to display data and not to hack a layout,
the only CSS-based implementation I have confidence in that:
1) works in the most common Windows browsers
2) does not involve extra tables or frames
3) does not involve turgid JavaScripts
4) prints well with repeating headers and footers
5) is drop-tested in production environments over several years

is this one:

http://web.tampabay.rr.com/bmerkey/e...le-header.html
Jul 21 '05 #6
Eric Kenneth Bustad wrote:

Any suggestion as to how to get rid of that stupid horizontal scrollbar?


What I have done is to place the tbody content inside a table, placed
this table inside a div and placed the div inside tbody. I removed
overflow:auto from tbody and applied it to the div. The div then is
scrollable instead of tbody and presents only a vertical scrollbar.
These changes worked for me:

tbody {height: 10em;}

<tbody>
<tr><td colspan="3">
<div style="height:1 0em;overflow:au to;">
<table style="width:10 0%;">
tbody content
</table>
</div>
</td></tr>
</tbody>

The cell widths need to be defined to equal their width for the two tables.

--
Gus
Jul 21 '05 #7
In article <Nu************ ********@golden .net>,
Gus Richter <gu********@net scape.net> wrote:
Eric Kenneth Bustad wrote:

Any suggestion as to how to get rid of that stupid horizontal scrollbar?


What I have done is to place the tbody content inside a table, placed
this table inside a div and placed the div inside tbody. I removed
overflow:aut o from tbody and applied it to the div. The div then is
scrollable instead of tbody and presents only a vertical scrollbar.
These changes worked for me:

tbody {height: 10em;}

<tbody>
<tr><td colspan="3">
<div style="height:1 0em;overflow:au to;">
<table style="width:10 0%;">
tbody content
</table>
</div>
</td></tr>
</tbody>

The cell widths need to be defined to equal their width for the two tables.


Well, yes, it is pretty easy if one is willing to set the column
widths explicitly. One *would* often prefer not to do that.

--
= Eric Bustad, Norwegian bachelor programmer
Jul 21 '05 #8
On Tue, 28 Jun 2005 02:15:06 GMT, Roedy Green <lo*****@mindpr od.com.invalid>
wrote:
In a spreadsheet you can arrange that column headers are always
visible no matter how much your scroll the table itself. What is the
best way to get this effect in CSS?. Does it require frames or is
there a better way?


This question seems to appear frequently. I suspect it's fear of
javascript that keeps it alive.

http://masonc.home.netcom.com has what you want.

Javascript calculations are active even though javascript is set OFF
in the browser. At least that's the way it seems to me.

The trick is:

#topBar { POSITION: fixed; POSITION: expression("abs olute");
TOP: 0em; TOP: expression(pars eInt(document.b ody.scrollTop +0));

(don't flame me for the "0" -- play with it if you wish)

Mason C
Jul 21 '05 #9
Eric Kenneth Bustad wrote:
The cell widths need to be defined to equal their width for the two tables.


Well, yes, it is pretty easy if one is willing to set the column
widths explicitly. One *would* often prefer not to do that.


You don't have to. Try the code I have given and you will note that it
performs as you asked; without the horizontal scrollbar.

The line about the cell widths was an after thought. If you try my demo
and incorporate the code mentioned, you will note that the columns for
the two tables do not line up. It's up to you if you are satisfied with
that.

--
Gus
Jul 21 '05 #10

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

Similar topics

2
1944
by: Joecx | last post by:
Hi Does anyone know how to set a list box to always be on top. If I create a text box after the listbox in the same location, the text box covers a portion of the listbox when I make the list box visible. I am looking for an always on top property in the list box but can't find one. I have however been able to delete the listbox and recreate it and then it maintains an always on top position. Thank you for any help anyone can offer!
4
1992
by: William Payne | last post by:
Hello, I am starting to steer away from the practice of using "using namespace std;" in my code. Instead I am qualifying each name in the source when I use them, for example: std::cout << "Hello"; Now to my question. Depending upon the status of my program, I return either EXIT_SUCCESS or EXIT_FAILURE from main(). Thinking that these constants live in the std namespace, I tried: return std::EXIT_FAILURE; but my compiler said:...
47
2707
by: Jeff Relf | last post by:
Hi All, I plan on using the following C++ code to create nodes with unlimited children: // I would like to declare NodeT like this, // but it won't compile because Lnk_T is not defined yet. struct NodeT { Lnk_T Lnk ; };
2
5293
by: Jon | last post by:
Hi all, I am trying to create a page that contains a number of div elements, with links on the left side of the page allowing the user to select which div to display. Some of the pages contain tables with border styles used to block off the columns and the headers, but not the individual rows. The pages will be displayed using IE 5.5 and later in the finished app. Now to the problem, which is a little awkward to describe:
9
5588
by: fochie | last post by:
Greetings, I'm having a problem when I try to GET a file from my server via xmlhttp when using Mozilla. With IE I can get any type of file fine, get/display headers fine, etc. With Mozilla, using the same HTML/JS it always returns no data (xmlhttp.responseText is null). When I try to get headers using Mozilla or display the http status code I get some obscure exception in the javascript console that I've given up on searching for an...
0
1926
by: Shravan | last post by:
Hi, I have a custom datagrid extended from .Net datagrid, where I want vertical scrollbar to be visible always, for that I handled visiblechanged of VerticalScrollbar and making it visible whenever it is made invisible. As far as this, it is OK, ther vertical scrollbar is visible always. But the problem comes when I am horizontally scrolling the grid, it scrolls only to the area where the last column is being overlapped by the vertical...
2
1244
by: Bob | last post by:
Hi, I'm not sure of the priority in execution between aspx and aspx.vb code. I define a tag which must be invisible as long as the user has not clicked in the dropdownlist. The problem is that it never becomes visible. When an user clicks in the dropdownlist, the page is postbacked, so it would be visible, no? Thanks for help Bob
4
4831
by: Miki | last post by:
Hello, I have a simple Tkinter window with and buttons at the bottom. When I resize the window to be shorter, the first thing to disappear are the buttons, however I want these button to be visible at all times. Is there a way to make sure that these buttons are always visible?
0
10578
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
9152
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7620
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
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
5522
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
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.