[jQuery] Re: 2 tables with same td width

2009-03-07 Thread Alain Roger
Hi, so i found why my code was not working...basically i found the reason but not how to walkaround it for now. in fact my data cells (2nd table) is loaded with a getJSON data collection (as you can see below): $.getJSON("lg.php",{ start: 0, offset : 10 }, function(data) {

[jQuery] Re: 2 tables with same td width

2009-03-06 Thread Alain Roger
sorry... i made a mistake... by .find('tr,td') i wanted to tell find("th,td") On Fri, Mar 6, 2009 at 9:23 PM, Alain Roger wrote: > Thanks MorningZ, > > i've check your code and there is something i do not understand... as i'm > still rookie to jQuery i'm maybe asking a stupid question , so in

[jQuery] Re: 2 tables with same td width

2009-03-06 Thread Alain Roger
Thanks MorningZ, i've check your code and there is something i do not understand... as i'm still rookie to jQuery i'm maybe asking a stupid question , so in this case sorry. when you call the following function Grid_Colunns_Resize($("#frm_table, #data_grid")); in fact $("#frm_table, #data_grid"

[jQuery] Re: 2 tables with same td width

2009-03-06 Thread MorningZ
But you aren't thinking about all three possibilities 1) Header Column X is wider than Data Column X 2) Data Column X is wider than Header Column X 3) they are the same So i don't know how *not* thinking about all three possibility would be "better" And i don't understand "like that what is imp

[jQuery] Re: 2 tables with same td width

2009-03-06 Thread Alain Roger
> > > What if the data table's first column is not wider than the header > table's first column? then you'll be smushing the header > in fact i was thinking to check each column headers first, and whatever width have the data columns, to allocate the column header widths to their respective d

[jQuery] Re: 2 tables with same td width

2009-03-06 Thread MorningZ
"from my point of view it's enough when i "scan" the header table and (whatever is column width in "slave table") to allocate this width to the data cell (slave table). am I wrong ?" What if the data table's first column is not wider than the header table's first column? then you'll be smushing

[jQuery] Re: 2 tables with same td width

2009-03-06 Thread Alain Roger
> > I knew you had 2 tables, and sorry if I came across as condescending (a lot > of people don't realize tables can have a header section). I'm just trying > to figure out why you need to have it split into two tables. Are you trying > to have the header cells follow the page as you scroll? If so,

[jQuery] Re: 2 tables with same td width

2009-03-06 Thread Alain Roger
On Fri, Mar 6, 2009 at 3:05 PM, MorningZ wrote: > > I don't know if you copy and pasted that code right from your tool of > choice, but you've got single and double quotes mixed up at > > > > use single quotes or double quotes, but not one of each, that will > cause major issues > Sorry Morning

[jQuery] Re: 2 tables with same td width

2009-03-06 Thread David Muir
Alain Roger wrote: On Fri, Mar 6, 2009 at 4:16 AM, David Muir > wrote: So you're saying you need to use js to sync the two tables so that you can use different styling for the header? Sounds like you should be updating your html markup instead. Hea

[jQuery] Re: 2 tables with same td width

2009-03-06 Thread MorningZ
I don't know if you copy and pasted that code right from your tool of choice, but you've got single and double quotes mixed up at use single quotes or double quotes, but not one of each, that will cause major issues also, your code for function "Grid_Colunns_Resize" is nothing like what i post

[jQuery] Re: 2 tables with same td width

2009-03-06 Thread Alain Roger
On Thu, Mar 5, 2009 at 9:41 PM, MorningZ wrote: > > Can you post (preferably on http://paste.pocoo.org/) what: > 1) What both tables look like? (as previously mentioned, your screen > shot only shows one table, that doesn't help) > 2) how you are assigning the variable "$slave_table" > > Seeing b

[jQuery] Re: 2 tables with same td width

2009-03-05 Thread Alain Roger
On Fri, Mar 6, 2009 at 4:16 AM, David Muir wrote: > So you're saying you need to use js to sync the two tables so that you can > use different styling for the header? Sounds like you should be updating > your html markup instead. > Header cells should be using th tags. > > > >

[jQuery] Re: 2 tables with same td width

2009-03-05 Thread David Muir
So you're saying you need to use js to sync the two tables so that you can use different styling for the header? Sounds like you should be updating your html markup instead. Header cells should be using th tags. Header1Header2 Cell1Cell2

[jQuery] Re: 2 tables with same td width

2009-03-05 Thread MorningZ
Can you post (preferably on http://paste.pocoo.org/) what: 1) What both tables look like? (as previously mentioned, your screen shot only shows one table, that doesn't help) 2) how you are assigning the variable "$slave_table" Seeing both those will help solve the issue On Mar 5, 2:14 pm, Alain

[jQuery] Re: 2 tables with same td width

2009-03-05 Thread Alain Roger
On Thu, Mar 5, 2009 at 8:10 PM, MorningZ wrote: > > nothing special and only one table shown > yes because my previous code and question belong to this table as you can see the following code should work... but it doesn't :-( $slave_table.find("tbody tr").find("td").each(function(i) { ... }); a

[jQuery] Re: 2 tables with same td width

2009-03-05 Thread MorningZ
nothing special and only one table shown On Mar 5, 1:45 pm, Alain Roger wrote: > On Wed, Mar 4, 2009 at 10:39 PM, MorningZ wrote: > > > I took a shot in the dark on what your HTML is like > > > here's a working example > > >http://paste.pocoo.org/show/106506/ > > > Note: the width's of cells a

[jQuery] Re: 2 tables with same td width

2009-03-05 Thread Alain Roger
On Wed, Mar 4, 2009 at 10:39 PM, MorningZ wrote: > > I took a shot in the dark on what your HTML is like > > here's a working example > > http://paste.pocoo.org/show/106506/ > > Note: the width's of cells are not know until the page is fully > loaded... hence the initial call to the function is i

[jQuery] Re: 2 tables with same td width

2009-03-05 Thread Alain Roger
On Wed, Mar 4, 2009 at 11:12 PM, donb wrote: > > Is thre some reason you can't do it with simple CSS directives? > Define a Class for each as appropriate and use the same class in > the td of both tables. No jQuery or javascript needed at all. > yes, because i have a different CSS code for head

[jQuery] Re: 2 tables with same td width

2009-03-04 Thread MorningZ
CSS doesn't help when you have no idea how wide a cell will be until you fill it with data On Mar 4, 5:12 pm, donb wrote: > Is thre some reason you can't do it with simple CSS directives? > Define a Class for each as appropriate and use the same class in > the td of both tables. No jQuery or j

[jQuery] Re: 2 tables with same td width

2009-03-04 Thread donb
Incidentally, if you are interested, the jGrid plugin deals with pretty much all the aspects of your apparent project already. On Mar 4, 4:39 pm, MorningZ wrote: > I took a shot in the dark on what your HTML is like > > here's a working example > > http://paste.pocoo.org/show/106506/ > > Note: t

[jQuery] Re: 2 tables with same td width

2009-03-04 Thread donb
Is thre some reason you can't do it with simple CSS directives? Define a Class for each as appropriate and use the same class in the td of both tables. No jQuery or javascript needed at all. On Mar 4, 4:39 pm, MorningZ wrote: > I took a shot in the dark on what your HTML is like > > here's a wo

[jQuery] Re: 2 tables with same td width

2009-03-04 Thread MorningZ
I took a shot in the dark on what your HTML is like here's a working example http://paste.pocoo.org/show/106506/ Note: the width's of cells are not know until the page is fully loaded... hence the initial call to the function is inside "$ (window).load" On Mar 4, 4:01 pm, MorningZ wrote:

[jQuery] Re: 2 tables with same td width

2009-03-04 Thread MorningZ
without an example of your HTML, i have no idea what your problem could be On Mar 4, 3:35 pm, Alain Roger wrote: > On Wed, Mar 4, 2009 at 3:20 PM, MorningZ wrote: > > > Some code i wrote > > >http://paste.pocoo.org/show/106445/ > > > Call it like: > > > Columns_Resize($("selector for tables to

[jQuery] Re: 2 tables with same td width

2009-03-04 Thread Alain Roger
On Wed, Mar 4, 2009 at 3:20 PM, MorningZ wrote: > > Some code i wrote > > http://paste.pocoo.org/show/106445/ > > Call it like: > > Columns_Resize($("selector for tables to line up widths")) > > Hi MorningZ, i tried to adapt the code to my purpose and i'm facing an interesting problem. $slave_ta

[jQuery] Re: 2 tables with same td width

2009-03-04 Thread MorningZ
Some code i wrote http://paste.pocoo.org/show/106445/ Call it like: Columns_Resize($("selector for tables to line up widths")) On Mar 4, 8:48 am, Alain Roger wrote: > Hi, > > i have 2 tables, 1 contains only headers and another only the data. > do not ask me why it is like...it has to :-) >

[jQuery] Re: 2 tables with same td width

2009-03-04 Thread MorningZ
I've got some code to do this This will line up all column widths in tables with class "R_Table" http://paste.pocoo.org/show/106443/ (note: never mind the line of the code dealing with class "header") On Mar 4, 8:48 am, Alain Roger wrote: > Hi, > > i have 2 tables, 1 contains only header