Table cell height parameter

Table cell height parameter

by John Isner -
Number of replies: 0
I'm looking for an html element that I can create with the editor, such that
  • I can adjust the size of the element (width, height)
  • I can embed an object in the element
The height and width of the object that I want to embed are both specified as 100%, so the object will fill the parent element.

I tried using a 1 x 1 table, but the table data (td) element's height does not track the table height. In other words, when I make the table larger by dragging the handles, the cell width tracks the table width, but the cell height remains constant at what looks like 100 pixels.

Here's the html for a table which I stretched to 500 px wide and 600 px high:

<table width: 500px; height: 600px; text-align: left; vertical-align: top;" border="1" frame="void" rules="none" width="100%"><tbody><tr><td valign="top" width="100%">EMBEDDED OBJECT HERE<br /></td></tr></tbody></table><br />

Notice that the td element has a width of 100%, (the default value in the Insert table dialog -- see screenshot). it has no height parameter.

If I toggle into the code view and add height="100%" ...

<table width: 500px; height: 600px; text-align: left; vertical-align: top;" border="1" frame="void" rules="none" width="100%"><tbody><tr><td valign="top" width="100%" height="100%">EMBEDDED OBJECT HERE<br /></td></tr></tbody></table><br />

then it works just fine. My object completely fills the cell, both horizontally and vertically.

I realize that you can specify the height in the Cell properties dialog, which is in the advanced table toolbar of the Enlarged editor. Why isn't the height settable in the simple Insert table dialog? And why isn't its default value 100%, rather than 100 pixels?

Maybe a better question is: Is there a more sensible way to do what I'm trying to do, i.e., a way that doesn't use tables?

Tested on Firefox browser and IE with Moodle 1.6.1 and 1.8.

Attachment Insert_table_dialog.png
Average of ratings: -