/    Sign up×
Community /Pin to ProfileBookmark

I have many html pages that the content in all of them is in a table. Can it bepossible to pop-win a window that open to the size of the table in the html? so i don’t have to fiddle with the size attribute of the window open script.

Thanks

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@JonaOct 21.2003 — [font=arial][color=maroon]This seems to work, but I haven't tested it in Netscape...[/color][/font]

[font=monospace]

<script type="text/javascript"><!--

ie = (navigator.appName=="Internet Explorer")?false:true;

var winObj = window.open("","winObj","width=400,height=400");

winObj.document.write('<table border="2">n<tr><th>One</th>n<th>Two</th>n</tr>n<tr><td>1</td>n<td>2</td>n</tr>n</table>');

w = (ie)?document.body.clientWidth:winObj.innerWidth;

width = winObj.document.getElementsByTagName("TABLE")[0].width - w;

h = (ie)?document.body.clientHeight:winObj.innerHeight;

height = winObj.document.getElementsByTagName("TABLE")[0].height - h;

winObj.resizeBy(width, height);

//--></script>

[/font]

[b][J]ona[/b]
×

Success!

Help @catchup spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.13,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,
)...