Archive for javascript・html ・css

Work-wrap in html table

 

<tablestyle=”table-layout: fixed”>

<tr><td style=”word-wrap: break-word”>

LongLongLongLongLongLongLongLongLongLongLong

LongLongLongLongLongLongLongLongLongLongLongLongLongLong

LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongWord

</td></tr></table>

But for my testing, the above code is only good for IE7. Not affect IE8/FF/Chrome.

Safari is looking good without any special code.

Comments

Can’t print in Safari browser after the new window shows up

Question:

Using Javascript window.open(‘….’); script, can’t print in Safari browser after the new window shows up.

The API for window.open() is
open (URL, windowName[, windowFeatures])
For safari browser, code as the following:
var win = window.open(‘about:blank’, ‘anyname’, ”);

URL: for IE, FF, Chrome, empty string will be OK, but safari has to use ‘about:blank’, otherwise the menubar will not show, i.e. page print will not working after the window show.

Comments