[jQuery] Re: having a child div inherit a parent width

2009-01-09 Thread roxstyle
thank you, this is the extensibility, i wanted, exactly. I need pracitce writing functions. i appreciate you time on this. On Jan 8, 7:48 pm, Karl Swedberg wrote: > Hi again, > > This should work: > > $(document).ready(function() { > >    var cellWidth = { >       searchUser: [80, 110, 145, 70,

[jQuery] Re: having a child div inherit a parent width

2009-01-08 Thread Karl Swedberg
Hi again, This should work: $(document).ready(function() { var cellWidth = { searchUser: [80, 110, 145, 70, 100, 100, 236], searchAcct: [80, 130, 80, 80, 80, 190, 201] }; $.each(cellWidth, function(key, val) { for (var i=0, cl= val.length; iNow if you add another table, (fo

[jQuery] Re: having a child div inherit a parent width

2009-01-08 Thread roxstyle
i actually started with more than one table, and my clunky code was working, but not clean. The following is the original for 2 tables. $(document).ready(function() { //usertool-search-user $(".searchUser tbody td:first-child").css({"width":"80px"}); $(".searchUser tbody td:nth-child

[jQuery] Re: having a child div inherit a parent width

2009-01-08 Thread roxstyle
thank you, so much. I need to think less in css and more in jquery. And also thank you for your great site, i just found it, and ordered your book. On Jan 8, 7:38 am, Karl Swedberg wrote: > This might be a little cleaner: > >    $(document).ready(function(){ >      var cellWidth = [80, 110, 145,

[jQuery] Re: having a child div inherit a parent width

2009-01-08 Thread Karl Swedberg
This might be a little cleaner: $(document).ready(function(){ var cellWidth = [80, 110, 145, 70, 100, 100, 236]; for (var i=0, cl= cellWidth.length; i $(document).ready(function(){ $(".searchUser tbody td:first-child").css({"width":"80px"}); $(".searchUser tbody td:nth-child(2)")

[jQuery] Re: having a child div inherit a parent width

2009-01-07 Thread roxstyle
$(document).ready(function(){ $(".searchUser tbody td:first-child").css({"width":"80px"}); $(".searchUser tbody td:nth-child(2)").css({"width":"110px"}); $(".searchUser tbody td:nth-child(3)").css({"width":"145px"}); $(".searchUser tbody td:nth-child(4)").css({"width":"70px"});

[jQuery] Re: having a child div inherit a parent width

2009-01-07 Thread amuhlou
you're quite welcome :) On Jan 7, 3:02 pm, roxstyle wrote: > thank you so much, that is going to work. > > On Jan 7, 11:55 am, amuhlou wrote: > > > I accidentally replied directly to the author, so for anyone curious > > about the same thing, you could use the following code: > > > $(document).

[jQuery] Re: having a child div inherit a parent width

2009-01-07 Thread roxstyle
thank you so much, that is going to work. On Jan 7, 11:55 am, amuhlou wrote: > I accidentally replied directly to the author, so for anyone curious > about the same thing, you could use the following code: > > $(document).ready(function() { >         $(".tbl tbody td").each(function(i) { >      

[jQuery] Re: having a child div inherit a parent width

2009-01-07 Thread amuhlou
I accidentally replied directly to the author, so for anyone curious about the same thing, you could use the following code: $(document).ready(function() { $(".tbl tbody td").each(function(i) { var $tdWidth = $(this).width(); $(this).children().width($tdWid

[jQuery] Re: having a child div inherit a parent width

2009-01-07 Thread roxstyle
no, not exactly. if the div contains a long email or url with no spaces-the div will expand beyond the intended width set for the "td" and essentailly break the table layout. What i am trying to achieve is to place the actual "td" content in a "div" and have the "div" (1) inherit the parent td w

[jQuery] Re: having a child div inherit a parent width

2009-01-07 Thread peet
isn't that not the same as setting "width:100%" to all childs? On Jan 7, 2:42 am, roxstyle wrote: > I have a table where each td has its width declared in css rules. > Inside some "td" i have either "p" or "div" > I want to have these elements inherit the width of the parent td. > I have a sam