[jQuery] Re: access table row[y] cell[x]

2009-02-03 Thread JAS
I'll give your idea a try. I am learning jQuery (albeit slowly). Thanks for your help. JAS On Feb 2, 11:01 pm, Ricardo Tomasi wrote: > You can also write your own methods, that's the beauty of jQuery: > > jQuery.fn.getCell = function(x,y){ >    return jQuery( this[0].rows[y].cells[x] ); > > };

[jQuery] Re: access table row[y] cell[x]

2009-02-03 Thread JAS
I agree. The overloading does make the methods inscrutable (at least for a beginner). JAS On Feb 3, 5:50 am, RobG wrote: > On Feb 3, 7:25 am, "Michael Geary" wrote: > > > That didn't work because .html is a method, not a property you can set. > > Not exactly - the issue is that the OP is assi

[jQuery] Re: access table row[y] cell[x]

2009-02-03 Thread JAS
Thanks, that's very clear. JAS On Feb 2, 10:25 pm, "Michael Geary" wrote: > That didn't work because .html is a method, not a property you can set. This > would have a better chance of working: > >   $('#myTable tr:eq(4) td:eq(3)').html( 'new text' ); > > But what was wrong with your original c

[jQuery] Re: access table row[y] cell[x]

2009-02-02 Thread RobG
On Feb 3, 7:25 am, "Michael Geary" wrote: > That didn't work because .html is a method, not a property you can set. Not exactly - the issue is that the OP is assigning a value to the jQuery.html property instead of calling the function referenced by it and passing the value as an argument. Th

[jQuery] Re: access table row[y] cell[x]

2009-02-02 Thread Ricardo Tomasi
You can also write your own methods, that's the beauty of jQuery: jQuery.fn.getCell = function(x,y){ return jQuery( this[0].rows[y].cells[x] ); }; $('#myTable').getCell(5,1).html('New content'); - ricardo On Feb 2, 7:25 pm, "Michael Geary" wrote: > That didn't work because .html is a metho

[jQuery] Re: access table row[y] cell[x]

2009-02-02 Thread Michael Geary
That didn't work because .html is a method, not a property you can set. This would have a better chance of working: $('#myTable tr:eq(4) td:eq(3)').html( 'new text' ); But what was wrong with your original code? It looked fine to me (except for the "var oCell =" part - that doesn't look right,

[jQuery] Re: access table row[y] cell[x]

2009-02-02 Thread Karl Swedberg
To set the html contents of matched elements using jQuery's .html() method, you would do it like this: $("#myTable tr:eq(4) td:eq(3)").html("new text") http://docs.jquery.com/Attributes/html#val --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 2, 2009

[jQuery] Re: access table row[y] cell[x]

2009-02-02 Thread JAS
With almost 1000 cells in my table, your solution doesn't sound all that easy to me. thanks, JAS On Feb 2, 3:55 pm, jQuery Lover wrote: > The easiest way is to give your td's unique id's and then use > $('#colXrowY').html() > > > Read jQuery HowTo Resource  -  http://jquery-howto.blogspot

[jQuery] Re: access table row[y] cell[x]

2009-02-02 Thread JAS
Well I tried: $("#myTable tr:eq(4) td:eq(3)").html = "new text"; and, while it gave no error, it also produced no result. Any other ideas? JAS On Feb 2, 5:15 pm, ksun wrote: > try $("#myTable tr:eq(4) td:eq(1)").html() for the 5th row and 2nd > column > > On Feb 2, 5:46 am, JAS wrote: > > >

[jQuery] Re: access table row[y] cell[x]

2009-02-02 Thread ksun
try $("#myTable tr:eq(4) td:eq(1)").html() for the 5th row and 2nd column On Feb 2, 5:46 am, JAS wrote: > I am (very) new to jQuery, and I have what I think must be a simple > question. > > Without jQuery, I would write: > > var oCell = document.getElementById('myTable').rows[5].cells > [2].inne

[jQuery] Re: access table row[y] cell[x]

2009-02-02 Thread jQuery Lover
The easiest way is to give your td's unique id's and then use $('#colXrowY').html() Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Mon, Feb 2, 2009 at 3:46 PM, JAS wrote: > > I am (very) new to jQuery, and I have what I think must be a simple > question. > > Without j