Lock
Lock

Reputation: 5522

Get size of returned data table in pixels

I have a jQuery file that uses the data function to request data from a PHP page. The PHP page returns a HTML table. I have this used as a popup, but I want to dynamically change the size of the popup so that the HTML table fits.

How do I go about this? I've given the returned table a class of 'status' and am trying to get the width and height of status, but have realised that this probably will give the CSS properties, and not the actual height.

  $(popElement).css({left:leftVal,top:topVal})
    .html("<div id='loading'></div>").load(url);
  var divHeight = $("table.status").width(); //this is the returned table

Any help appreciated.

Upvotes: 0

Views: 468

Answers (1)

Ry-
Ry-

Reputation: 225074

No, .width works just fine for measuring an element. Really; try it. Or you could look at the documentation.

Upvotes: 1

Related Questions