i'm having a parent div and inside that child element will be table.
i'm hidding some columns in the table thro' css becoz to avoid inline-style.
so how can i reflect the width to parent div after hidding the column of table...
i'm having a parent div and inside that child element will be table.
i'm hidding some columns in the table thro' css becoz to avoid inline-style.
so how can i reflect the width to parent div after hidding the column of table...
$("#yourtableid").width();
returns the computed pixel width of the table element with id yourtableid.
$("#yourdivid").width ( $("#yourtableid").width() );
will set the parent div width.
See
Maybe you'll need to use jQuery innerWidth()
method (calculates elements width with padding without calculating border width) and outerWidth()
(calculates elements width with padding and border size included). I you'll supply optional boolean argument to outerWidth()
like outerWidth(true)
it'll include also size of margins.
So in this case your code will be
$("#yourdivid").width ( $("#yourtableid").innerWidth() );
Hope it'll help.