Debarati Chatterjee

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromDebarati Chatterjee
ToMe
SubjectFreezing column problem in Firefox2.2 though it is working fine in IE6.0
Date4 January 2007 11:30
Hello Jones

[Snip.]

I am facing a problem regarding Freezing a table column in Firefox browser
although the
same code is working fine for IE 6.0.

I have used an ASP table and added rows dynamically.
<asp:table id="table1" Runat="server"></asp:table>
also i have set the style dynamically at run time.

I am furnishing the code snippet for your ready reference.


// This sets the Z Index of this Cell - To be more precise, Z Index locks
the whole cell so that it cannot move.

thcHeaderName.CssClass = "DataTableHeader";

thcHeaderName.Style.Add("Left",
"expression(document.getElementById(\'tbl-container\').scrollLeft)");

thcHeaderName.Style.Add("Z-INDEX","30");

thcHeaderName.HorizontalAlign = HorizontalAlign.Left;



This is working fine in IE 6.0 but absolutely not working for FireFox 2.2.

Please do suggest me some possible option.

Thanks and regards

Debarati Chatterjee
FromMe
ToDebarati Chatterjee
SubjectRe: Freezing column problem in Firefox2.2 though it is working fine in IE6.0
Date4 January 2007 12:18
Hello Jee ;)

> I am facing a problem regarding Freezing a table column in Firefox browser
> although the same code is working fine for IE 6.0.

Neither of those browsers are particularly useful for debugging [for me].
Does it work in Opera? http://www.opera.com/download/
What error messages appear in Opera's error console?

But what do you mean by "freezing"? Are you saying that you want to use CSS
position:fixed? If so, I suggest you see my earlier email on this subject:
http://www.howtocreate.co.uk/emails/TJSteed.html

> expression(document.getElementById(\'tbl-container\').scrollLeft)

Expressions are invalid CSS that only IE understands. They should be avoided
if at all possible. Besides that, scrollLeft is also an IE invention, and
other browsers may not implement it on arbitrary elements.

> thcHeaderName.CssClass = "DataTableHeader";
> thcHeaderName.Style.Add("Z-INDEX","30");

This is not CSS, and I do not know ASP. Like the browsers, I work with the
output from the ASP. If my earlier email does not help you, can you show me
the output that this ASP script produces?

> FireFox 2.2.

Firefox 2.2 does not exist. I assume you mean Firefox 2.0.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromDebarati Chatterjee
ToMe
SubjectRe: Freezing column problem in Firefox2.2 though it is working fine in IE6.0
Date5 January 2007 05:13
AttachmentExample using "LEFT: expression(document.getElementById('tbl-container').scrollLeft); POSITION: relative"
Hello Jones

I think you are right on the regard that
'expression(document.getElementById(\'tbl-container\').scrollLeft)'  is
resticted to IE 6.0 .
I am briefly stating you my requirement :

I have a table in my ASPX page the first column of which should be locked(
like we can Freeze panes in Excel worksheet).
This table is wrapped inside a DIV element ''tbl-container"
The table is an asp:table which is generated in the code behind file
dynamically.
Now i want to fix the entire 1st column including the Header , for this i
have used
thcHeaderName.Style.Add("POSITION", "relative"); [thcHeaderName is the name
of the Headercell]

thcHeaderName.Style.Add("Left",
"expression(document.getElementById(\'tbl-container\').scrollLeft)");

thcHeaderName.Style.Add("Z-INDEX","30");

This is not working in FireFox 2.0  though it is working fine in IE 6.0 .



Can you sugest me some possible solution so that i can make my code work in
cross browser enviornment.

I am attaching the html files for ur ready reference(1st output taken from
IE 6.0 browser  and other output is taken from FF 2.0 ).

Please suggest me some solution as it is required urgently.



Thanks and regards

Debarati Chatterjee
FromMe
ToDebarati Chatterjee
SubjectRe: Freezing column problem in Firefox2.2 though it is working fine in IE6.0
Date6 January 2007 18:31
Debarati,

> I think you are right on the regard that 'expression...' is resticted
> to IE 6.0 .

Yes, I know it is IE specific, that's why I said it. Expressions are
non-standard IE garbage. You cannot expect any other browser to support
them.

> This is not working in FireFox 2.0  though it is working fine in IE 6.0

As I said, neither of these are particularly useful for debugging. I asked
you to provide details for Opera. Please provide details for Opera in any
future communication, and tell me what error messages appear in Opera's
error console.

In this case, you can see Opera says this:
HTML style attribute
Declaration syntax error
Line 1:
  EX: 20; ; LEFT:
expression(document.getElementById('tbl-container').scrollLeft);

This is a good example that shows you that you are using something that you
should not be using. It is invalid.

> Can you sugest me some possible solution so that i can make my code work
> in cross browser enviornment.

Firefox does not allow relative positioning on table cells. The only option
is to use absolute positioning or fixed positioning, as I showed in this
previous email:
http://www.howtocreate.co.uk/emails/TJSteed.html


Tarquin (yes, that is my name, not "Jones" :) )
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.