Hello, I have a question about text positioning in a table field.
In particular, I want to create a template which works with images
of unknown size.
There is a <table> field, in which I need to put:
* a <div> supplied to the template, that contains an image of unknown
size (this needs to be centered horizontally)
* a caption supplied to the template to put below the image
(_left_aligned_ with the image).
The field width (enforced by the rest of the table) may be larger than
the image, so a simple
<div ...>IMAGE
<div style="text-align:left;">caption</div>
</div>
won't work, as it will look like this:
+-------------------+ fig. 1
| +---------+ |
| | image | |
| | | |
| +---------+ |
|caption |
+-------------------+
and I want it like this:
+-------------------+ fig. 2
| +---------+ |
| | image | |
| | | |
| +---------+ |
| caption |
+-------------------+
Any ideas would be greatly appreciated!
TIA,
Stanislav
PS: code for fig. 1:
<table style="border: 1px solid;">
<tr><td style="text-align: center;">
<div style="background:lightgreen;">
<div><img style="border: 2px solid;" src="..." alt="IMAGE IS HERE"/></div>
<div style="text-align: left">caption</div>
</div>
</td></tr>
<tr><td>other field that makes table wide, quite wide in fact.</td></tr>
</table>