PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Graphisme & Infographie > macromedia.dreamweaver > Freeze table header
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Freeze table header

Réponse
 
LinkBack Outils de la discussion
Vieux 13/06/2008, 16h57   #1
Karlhevera
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Freeze table header

Some of my tables are long and have to be scrolled down. Where can I find code which will freeze the table header whilst the table is scrolled up/down, please?

karl,London,Uk
  Réponse avec citation
Vieux 13/06/2008, 17h17   #2
djinn
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

Karlhevera wrote:
> Some of my tables are long and have to be scrolled down. Where can I find code which will freeze the table header whilst the table is scrolled up/down, please?
>
> karl,London,Uk



Hi,

http://www.dreamweaverresources.com/tutorials/index.htm

HTH

--
chin chin
Sinclair
  Réponse avec citation
Vieux 13/06/2008, 17h28   #3
Michael Fesser
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

..oO(Karlhevera)

>Some of my tables are long and have to be scrolled down. Where can I
>find code which will freeze the table header whilst the table is
>scrolled up/down, please?


In theory it's quite simple: Wrap your table headers in a 'thead'
element, the data rows in one or more 'tbody' elements. With some CSS
you could then make the data part scroll.

So much for the theory. In practice you can almost forget it because of
lacking browser support. Even in many modern browsers this doesn't work
well enough. You'd have to test it.

Here's something to play with, try it with Firefox:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<title>Scrolling Table</title>
<style type="text/css">
table {border: 1px solid #000}
tbody {overflow: scroll; height: 400px}
td {width: 200px}
</style>

<table>
<thead>
<tr><th>foo</th><th>bar</th></tr>
</thead>
<tfoot>
<tr><th>foo</th><th>bar</th></tr>
</tfoot>
<tbody>
<tr><td>01</td><td>01</td></tr>
<tr><td>02</td><td>02</td></tr>
<tr><td>03</td><td>03</td></tr>
<!-- add some more content rows -->
<tr><td>38</td><td>38</td></tr>
<tr><td>39</td><td>39</td></tr>
<tr><td>40</td><td>40</td></tr>
</tbody>
</table>


Micha
  Réponse avec citation
Vieux 13/06/2008, 17h57   #4
Murray *ACE*
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

Sure looks poopy in IE7.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Michael Fesser" <netizen@gmx.de> wrote in message
news:hc65545cd5ras6bt1o566ftncubc4u11dc@4ax.com...
> .oO(Karlhevera)
>
>>Some of my tables are long and have to be scrolled down. Where can I
>>find code which will freeze the table header whilst the table is
>>scrolled up/down, please?

>
> In theory it's quite simple: Wrap your table headers in a 'thead'
> element, the data rows in one or more 'tbody' elements. With some CSS
> you could then make the data part scroll.
>
> So much for the theory. In practice you can almost forget it because of
> lacking browser support. Even in many modern browsers this doesn't work
> well enough. You'd have to test it.
>
> Here's something to play with, try it with Firefox:
>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <title>Scrolling Table</title>
> <style type="text/css">
> table {border: 1px solid #000}
> tbody {overflow: scroll; height: 400px}
> td {width: 200px}
> </style>
>
> <table>
> <thead>
> <tr><th>foo</th><th>bar</th></tr>
> </thead>
> <tfoot>
> <tr><th>foo</th><th>bar</th></tr>
> </tfoot>
> <tbody>
> <tr><td>01</td><td>01</td></tr>
> <tr><td>02</td><td>02</td></tr>
> <tr><td>03</td><td>03</td></tr>
> <!-- add some more content rows -->
> <tr><td>38</td><td>38</td></tr>
> <tr><td>39</td><td>39</td></tr>
> <tr><td>40</td><td>40</td></tr>
> </tbody>
> </table>
>
>
> Micha


  Réponse avec citation
Vieux 13/06/2008, 18h05   #5
Michael Fesser
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

..oO(Murray *ACE*)

>Sure looks poopy in IE7.


I guess as impressive as in IE 6 ...

A conditional comment might , so that IE will get the normal non-
scrolling table. But the entire approach is rather unreliable, as said.

Micha
  Réponse avec citation
Vieux 13/06/2008, 18h21   #6
Karlhevera
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

djinn: sorry, but could not find anything at the link?
  Réponse avec citation
Vieux 13/06/2008, 18h27   #7
Karlhevera
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

Murray *ACE* - does not look too promising :-(.. A thought: could I create the
header as a separate 1 row table in a layer, which will be above the actual
table. In scrolling, the actual table will scroll, whilst the separate header
should remain static? Just a wild thought, will try it and report back...

  Réponse avec citation
Vieux 13/06/2008, 18h28   #8
Murray *ACE*
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

Nasty option. I wouldn't do it.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Karlhevera" <webforumsuser@macromedia.com> wrote in message
news:g2uaml$kp1$1@forums.macromedia.com...
> Murray *ACE* - does not look too promising :-(.. A thought: could I
> create the
> header as a separate 1 row table in a layer, which will be above the
> actual
> table. In scrolling, the actual table will scroll, whilst the separate
> header
> should remain static? Just a wild thought, will try it and report back...
>


  Réponse avec citation
Vieux 13/06/2008, 18h56   #9
djinn
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

Karlhevera wrote:
> djinn: sorry, but could not find anything at the link?


http://www.dreamweaverresources.com/.../scroller.html

--
chin chin
Sinclair
  Réponse avec citation
Vieux 13/06/2008, 19h46   #10
Karlhevera
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

Murray: if it is a 'nasty option', what would you suggest to achieve the same result?. I have done it and it seems to be OK... at http://www.gardensoflondon.co.uk/eve...anisations.htm
  Réponse avec citation
Vieux 13/06/2008, 19h54   #11
Murray *ACE*
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

Resize your text.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Karlhevera" <webforumsuser@macromedia.com> wrote in message
news:g2ufah$ppd$1@forums.macromedia.com...
> Murray: if it is a 'nasty option', what would you suggest to achieve the
> same result?. I have done it and it seems to be OK... at
> http://www.gardensoflondon.co.uk/eve...anisations.htm


  Réponse avec citation
Vieux 14/06/2008, 09h00   #12
Karlhevera
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

So I resized the heading font from 16 to 14px... What is that supposed to do?
Is resizing the font your way to achieve what I set out to do...to freeze the
heading.

I did find an 8 pages of how to achieve the freeze, written by somebody
bmerkey@tampabay.rr.com I found it is complicated, that I did not even attempt
it...


  Réponse avec citation
Vieux 14/06/2008, 11h57   #13
Murray *ACE*
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

Resize IN THE BROWSER, not in the code. And go larger, not smaller.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Karlhevera" <webforumsuser@macromedia.com> wrote in message
news:g2vtqs$ed4$1@forums.macromedia.com...
> So I resized the heading font from 16 to 14px... What is that supposed to
> do?
> Is resizing the font your way to achieve what I set out to do...to freeze
> the
> heading.
>
> I did find an 8 pages of how to achieve the freeze, written by somebody
> bmerkey@tampabay.rr.com I found it is complicated, that I did not even
> attempt
> it...
>
>


  Réponse avec citation
Vieux 15/06/2008, 08h15   #14
Karlhevera
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

Surely, resizing in the BROWER is the users' choice. It's up to them, whether
they want the text appear larger or smaller. It may look just fine, if I
enlarge it, but would it look OK elsewhere? From what I have seen, some of it
does, some does not...
I have resized, sitewide, the topic headings. It looks nicer, but cannot see
how this is the solution to freezing the header of a table. The table might
appear marginally smaller vertically, but not small enough to remove the
scroll...
My solution may not be al that 'elegant', 'poopie' or even 'nasty' to some of
you, but it works... I am yet to see an alternative suggestion from anyone here.
Djinn had a suggestion, but cannot see how it would work with a table with
many lines. Works fine in a single cell frame....

  Réponse avec citation
Vieux 15/06/2008, 12h58   #15
Murray *ACE*
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

> but cannot see how this is the solution to freezing the header of a
> table.


It is not the solution. It is the problem. Resizing text blows your
absolutely positioned table header out of the water (and the rest of the
page, too).

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Karlhevera" <webforumsuser@macromedia.com> wrote in message
news:g32fi7$5ub$1@forums.macromedia.com...
> Surely, resizing in the BROWER is the users' choice. It's up to them,
> whether
> they want the text appear larger or smaller. It may look just fine, if I
> enlarge it, but would it look OK elsewhere? From what I have seen, some
> of it
> does, some does not...
> I have resized, sitewide, the topic headings. It looks nicer, but cannot
> see
> how this is the solution to freezing the header of a table. The table
> might
> appear marginally smaller vertically, but not small enough to remove the
> scroll...
> My solution may not be al that 'elegant', 'poopie' or even 'nasty' to some
> of
> you, but it works... I am yet to see an alternative suggestion from anyone
> here.
> Djinn had a suggestion, but cannot see how it would work with a table with
> many lines. Works fine in a single cell frame....
>


  Réponse avec citation
Vieux 15/06/2008, 16h52   #16
djinn
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

Karlhevera wrote:

> Djinn had a suggestion, but cannot see how it would work with a table with
> many lines. Works fine in a single cell frame....
>


Insert your table within the scrolling table cell in the example I
pointed your to - adjust width etc of container (this bit in the example)...

<div style="width: 490px; height: 450px; overflow: auto; padding: 10px;
border: 1px solid black; background-color:#F3F3E9;">

.... to suit your table.

--
chin chin
Sinclair
  Réponse avec citation
Vieux 21/06/2008, 12h22   #17
Karlhevera
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

been away, hence the delay in replying. Thanks for your comments and will try as djinn said
  Réponse avec citation
Vieux 24/06/2008, 16h32   #18
Karlhevera
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Freeze table header

Thanks. But you missed the point... In the example you quote, the header table
is a SEPARATE image, whereas in my table, it is the FIRST line of the table,
suitably changed, hence the scrolling. I could have used a 'Caption' option,
but that did not suit me. That's why I did a separate little table, just of
the heading, to fit over the main table.
It seems to work fine. Maybe some fine tuning has to be done..

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 18h44.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,23173 seconds with 26 queries