I have a pixel size table whose cell width depends on the content. There are input elements in the first row of the table, and I need them to have the same width as their parents (). The idea is that the width of this input should be calculated automatically and set in pixels using jQuery. There are no classes or identifiers for these cells and inputs. I can set the width for a single cell only with selectors with code like this:
var parentWidth = $(".foo").width(); $('td.foo input').width(parentWidth);
But, as I said, I need it to be more universal without using any classes, etc. Can someone help me with this? Thanks!
Mitya ustinov
source share