473,396 Members | 2,030 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,396 software developers and data experts.

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 9242
On Tue, 28 Jun 2005 02:15:06 GMT, Roedy Green <lo*****@mindprod.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("absolute");
TOP: 0em; TOP: expression(parseInt(document.body.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********@netscape.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:10em;overflow:auto;">
<table style="width:100%;">
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********@netscape.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: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:10em;overflow:auto;">
<table style="width:100%;">
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*****@mindprod.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("absolute");
TOP: 0em; TOP: expression(parseInt(document.body.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
I would like to set up a webpage on the internet does any one have any advise on how to
go about doing this. I know how to read and write html and know a little about css as it
relates to the previous. To I need to open a account for a ftp and what do I do to make
sure I can protect other peoples privacy. Since last time that I used lynx which had come
packaged with my Global Village modem I see that there are alot of changes including the
complexity of the pogram itself.I know a little bit about both html and css and how to write
code as well as how to read it. Can I set up a free ftp and if so where? Please feel free
to write me at my e-mail address.
Jul 21 '05 #11
On Tue, 28 Jun 2005 03:23:51 -0400, Gus Richter
<gu********@netscape.net> wrote or quoted :
<http://www.home.golden.net/~richterf/Michael/Special.html>
Requires a Gecko based browser to view properly (overflow:auto; applied
to tbody).


That's interesting. The catch is in IE it looks dreadful. I have a
similar problem. I have customers with nojava, crappy Java and recent
java engines installed. I really should somehow be showing them
different html, at least for part of a page.

--
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 #12
On Tue, 28 Jun 2005 18:47:56 -0400, Gérard Talbot
<ne***********@gtalbot.org> wrote or quoted :
Cross-browser scrolling tbody:
http://www.gtalbot.org/HTMLJavascrip...lingTBody.html


Unfortunately that page fails in opera 8.0.1. I have reported it.

--
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 #13
Roedy Green wrote:

That's interesting. The catch is in IE it looks dreadful.


By applying the changes which I posted (workaround), by placing another
table inside a div and the div inside tbody, it looks and works ok for
IE and Opera as well. Additionally, IE requires TR height in the
embedded table.

Opera has been aware of this overflow:auto problem since several
versions ago.

--
Gus
Jul 21 '05 #14
On Thu, 30 Jun 2005 18:53:22 GMT, http://ww**************@yahoo.com
wrote or quoted :
I would like to set up a webpage on the internet does any one have any advise on how to
go about doing this. I know how to read and write html and know a little about css as it
relates to the previous. To I need to open a account for a ftp and what do I do to make
sure I can protect other peoples privacy. Since last time that I used lynx which had come
packaged with my Global Village modem I see that there are alot of changes including the
complexity of the pogram itself.I know a little bit about both html and css and how to write
code as well as how to read it. Can I set up a free ftp and if so where? Please feel free
to write me at my e-mail address.


Normally you let some ISP set that up for you. there are free ones.

See my list http://mindprod.com/jgloss/isp.html
To find a utility to let you upload files see
http://mindprod.com/jgloss/ftp.html

IF you don't know how to compose html, you can learn it pretty easily
just from the html cheat sheet. see
http://mindprod.com/jgloss/htmlcheat.html

It will point you to some tutorials.

You get your webpages working so that you can browse and link between
them on your local site. when it is all as you wish, you upload the
lot to your ISP.

The hard part is getting your CSS style sheets to work. see
http://mindprod.com/jgloss/css.html for resources to help there.

I am just about to start trying out Dreamweaver, which is what many
people are using to compose. I just use a text editor and my own macro
generator for intelligent boilerplate.


--
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 #15
On Tue, 28 Jun 2005 23:37:10 GMT, "Brett Merkey"
<bm*****@tampabay.rr.com> wrote or quoted :
http://web.tampabay.rr.com/bmerkey/e...le-header.html


in opera, the headers still scroll, but at least table is usable.

This is an elegant solution, no messy markup. Magically all your
tables can start behaving this 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 #16

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

Similar topics

2
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...
4
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";...
47
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....
2
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...
9
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,...
0
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...
2
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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,...
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.