0

As you know, an HTML <table> element can have a lot of geometry variation for width and height of cells and the whole table overall. The browser does a lot of work re-sizing cell height and width to fit "nicely." in the available window size. A huge range of variation exists in table geometry, of course.

When an <object> contains an HTML <table>, that former tag can specify width="100%" (or some fixed pixel width), which render pretty well for nominal cases. However if the table height as-rendered is rather large, setting height="100%" doesn't yield a very tall table, and it's not dynamic as the browser window changes. And using fixed pixel height= is unhelpful if you don't know the as-rendered height in advance. If you're relying on the browser to arrange the cells in its default behavior.

Does anyone know any tricks to get <object> to better respect the dimensions of an HTML <table> inside it? I can picture the <object> inquiring its contents for height or width attributes on a root element, e.g. SVG markup has these and resizes the containing <object> smartly. Would it help to fake out <object> by including these attributes in the <table> markup? (I've tried, but no joy in limited attempts).

I wish <object> were smarter about this, but apparently it's not.


The first thing to do is to look at how you're calling the function. Assuming it's in myModule.py, did you import myModule or did you from myModule import calrounds? If you used the first one, you need to call it as myModule.calrounds().

Next thing I would do is to make sure that you're restarting your interpreter. If you have imported a module, importing it again will not reload the source, but use what is already in memory.

The next posibility is that you're importing a file other than the one you think you are. You might be in a different directory or loading something from the standard library. After you import myModule you should print myModule.__file__ and see if it is the file you think you're working on. After 20 years of programming, I still find myself doing this about once a year and it's incredibly frustrating.

Finally, there's the chance that Python is just acting up. Next to your myModule.py there will be a myModule.pyc - this is where Python puts the compiled code so it can load modules faster. Normally it's smart enough to tell if your source has been modified but, occassionally, it fails. Delete your .pyc file and restart the interpreter.

4

1 に答える 1

0

いいえ。

代わりにシームレスなiframeを使用できます(ただし、これは現時点ではブラウザーのサポートが制限されている最先端の機能です)。

于 2013-02-05T17:34:57.207 に答える