Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / September 2006



Tip: Looking for answers? Try searching our database.

floating problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Veerle - 28 Sep 2006 08:39 GMT
I have the following html:

<table cellpadding="0" cellspacing="0" width="850">
<tr>
   <td>
       <div id="messagebox">
           <div class="Dialog">
               <div class="DialogHeader">Fouten</div>
               <div class="DialogBody">
                   ...
               </div>
           </div>
       </div>
   </td>
   <td style="vertical-align: top; padding-top: 10px; text-align:
right">
       <input type="image" name="saveBtn" id="saveBtn"
src="images/nl-BE/b_Save.gif" style="border-width:0px;" />
   </td>
</tr>
</table>

If the content int he DialogBody is wide enough, this gives the
expected behaviour: the td with the save button takes up its minimal
width being the width of the image. The messagebox div takes the rest.
But if the content of DialogBody is empty, the table decides itself
what the widths of the colums are and then the width of the messagebox
is about 40% of the table width and the td with the button is the other
60%.

It is not possible to give the td with the button a static width,
because the button that is shown is determined by an asp.net page and
it can be a wide button or a small button.

I tried making two divs: one for the messagebox, one for the button
area, and set them both to float right, but then the messagebox div
always (with content or without content in the DialogBody) takes the
full 850px and the buttons move to under the messagebox.

What I want is the behaviour of the messagebox with lots of text in it
even when the content of DialogBody is empty and without giving the
button area a static width.
Els - 28 Sep 2006 08:53 GMT
> It is not possible to give the td with the button a static width,
> because the button that is shown is determined by an asp.net page and
> it can be a wide button or a small button.

AFAIK TDs stretch when they need to contain stuff that is too wide for
the given width.

Signature

Els                           http://locusmeus.com/
accessible web design:     http://locusoptimus.com/

Now playing: Richenel - Dance Around The World

Ben C - 28 Sep 2006 09:21 GMT
> I have the following html:
>
[quoted text clipped - 38 lines]
> even when the content of DialogBody is empty and without giving the
> button area a static width.

If I understand correctly, you want the second <td> to be as small as
possible, so it just shrink-wraps the image?

In that case, just set the <td> with the image in it to width: 1px. As
Els pointed out in another followup, <td>s never overflow, the table
will stretch to fit. But the UA will try to get as close to the 1px you
asked for as it can, without allowing the content to overflow. This
makes column 1 bigger and column 2 just big enough for the content.
Veerle - 28 Sep 2006 12:29 GMT
Thanks Els and Ben, this indeed solves the problem.

Ben C schreef:

> > I have the following html:
> >
[quoted text clipped - 47 lines]
> asked for as it can, without allowing the content to overflow. This
> makes column 1 bigger and column 2 just big enough for the content.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.