Ve sve webove aplikaci potrebuji, aby u tabulky (ASP.NET komponenta GridView) zustala hlavicka sloupcu na svem miste i pri vertikalnim scrollovani. Oblast hlavicky mi popisuje nasledujici styl.
.GVFixedHeader
{
background-color: Green;
position:relative;
width:94%;
}
V IE mi to funguje, ale na Mozzile ne, nevite nekdo co s tim?
Fórum › CSS
Nepohybliva oblast

To Nefaritus :
Ne, position musi zustat relative, jinak se pri skrolovani te oblasti hlavicka pohne (i kdyz je to nastaveni na fixni pozici). Spise mi jde o, jako by Mozzila mela s tou konstrukci position:relative nejaky problem.
Asi jako kdyz chci, text-align:center na netextovy objekt v Mozzile musim pridat margin:0 auto; tak jest-li neco podobneho se nevyskytuje pro position:relative pro Mozzilu.
Jirka12
Něco jako[1]? Google neporadil[2]?
aby u tabulky (ASP.NET komponenta GridView) zustala hlavicka sloupcu na svem miste i pri vertikalnim scrollovani
Nějak nevím, co si pod tím přesně představit? Hlavička má být na stejném místě vzhledem k ostatním prvkům na stránce (tzn. že když budu scrollovat dolů, hlavička se bude šoupat nahoru až nakonec zmizí za ovládacími prvky prohlížeče), nebo k výhledu na stránku z okna prohlížeče (tzn. že ji pořád uvidím, i když odscolluji třebas 5km stránky)?
Spise mi jde o, jako by Mozzila mela s tou konstrukci position:relative nejaky problem.
Jseš si jistý, že position: relative je opravdu to, co potřebuješ? Není to jen nějakým nestandardním chováním IE, že to dělá zrovna to, co chceš?
Asi jako kdyz chci, text-align:center na netextovy objekt v Mozzile musim pridat margin:0 auto;
Jestli se nepletu, tak chování, jaké má Gecko (FF), Webkit (Chrome, Safari), Presto (Opera) ad. je to, jaké popsáno ve standardu CSS; jenom Trident v IE umožňuje zarovnávat blokové elementy (display: block) pomocí text-align.
[1] http://www.codeproject.com/KB/webforms/DataGridFixedHeader.aspx
[2] http://www.google.cz/search?q=asp.net+gridview+verticall+scrolling
Svuj problem jsem stale nevyresil a tak se ho pokusim jeste vice upresnit, jest-li nahodou nekdo nekdy neresilt podobny problem
Vygooglil jsem si par navodu, jak udelat GridView v ASP.NET s vertikalnim scrollbarem.
Problem mam v tom, ze na IE 6.0 a Mozzile se mi hlavicka gridview scrolluje spolecne s daty. Stava se mi to pri obou nasledujicich reseni:
I.reseni
.fixedHeader
{
overflow: auto;
height: 200px;
width: 500px;
}
table th
{
border-width: 1px;
border-color:Gray;
background-color:plum;
position: relative;
top: expression(this.parentNode.parentNode.parentNode.scrollTop-1);
}
<asp:panel ID="Panel3"
runat="server"
ScrollBars="Auto"
Height="163px"
Width="300px"
CssClass="fixedHeader"
>
<asp:GridView ...
II.reseni
<style type="text/css">
.GVFixedHeader { font-weight:bold; background-color: Green;
position:relative; top:expression
(this.parentNode.parentNode.parentNode.scrollTop-1);}
</style>
<aspanel runat="server" ID="pnlContainer" ScrollBars="Auto" Height="150px"
Width="400">
<asp:GridView ShowFooter="True" runat="server" Width="96%" ID="gvDemo"
AutoGenerateColumns="False">
<HeaderStyle CssClass="GVFixedHeader" />
Nevite nekdo, co mam zmenit, aby se hlavicka gridview pri scrollovani neposouvala ani na Mozzille ani na IE 6.0

Přidej příspěvek
Ano, opravdu chci reagovat → zobrazí formulář pro přidání příspěvku
×Vložení zdrojáku
×Vložení obrázku
×Vložení videa
































Uživatelé prohlížející si toto vlákno
Podobná vlákna
Oznamovací oblast — založil
Výměna zpětných odkazů - PR 5, oblast IT — založil Anonymní uživatel
Jak vybrat a posunout oblast obrázku? — založil imcon
Excel - vzorce pro vybranou oblast — založil Petas
Rolování určité oblasti — založil minarth
Moderátoři diskuze