|
Posted by Ben C on 06/05/07 09:48
On 2007-06-04, laredotornado@zipmail.com <laredotornado@zipmail.com> wrote:
> Hi,
>
> I have a table of two rows. The first row contains a single cell with
> an image. The second row contains a cell with a smaller table,
> containing an image and text on the same row. My problem is, I want
> the width of the whole table to be the width of the image in the first
> row. However, I don't want to hard code this width because it might
> change. But right now, the second row's width is expanding to fill
> the entire browser screen. Can I restrict the second row's width to
> be the first row's width without hard-coding a pixel size?
You can set the width of the cell in the second row to 1px. That won't
make it 1px wide, but as narrow as possible without breaking words.
Provided that that minimum width is narrower than the image in the first
row, then the overall table width will be determined by the width of the
image.
> Here's the code:
>
> <table border="0" cellspacing="0" cellpadding="0">
> <tr><td><img name="coffee_header" alt="The Americas"
> src="images/coffeetheamerica.jpg" border="0"></td></tr>
> <tr><td>
^^^^
Change that one to <td width="1">
[...]
Navigation:
[Reply to this message]
|