473,773 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS Float & Table Won't Play Nicely

3 New Member
I've been banging my head against an interaction between a table and float element.

I want the two of them to together take up 100% of the width of their container. If the table cells' content were to wrap around the float, even better, but that's not necessary.

However, I'm continuously running into two issues:

1.) If I make my table 100%, it writes over the float: right for tables where the content text is long enough.

2.) If I don't make my table 100%, the table is only as wide as the content (and thus looks bad).

Here's an example of the former:
http://index.rpg.net/display-entry-N...l?mainid=10503

Expand|Select|Wrap|Line Numbers
  1. <div class='boxLined smallwords' style='float: right; text-align: center'>
  2.  
  3.   <a target='_blank' href='/pictures/show-water.phtml?picid=12427'><img align='center' border=0 src='/pictures/show-thumbnail.phtml?picid=12427&maxWidth=150&maxHeight=300'></a>
  4.  
  5. </div>
  6.  
  7. <div>
  8.   <table class='boxWide'>
  9.  
  10. # I suspect any wide content here does the trick
  11.  
  12. <tr style="background-color:#BBBBFF"><td class='padded' align='right' width='100'><b>Title</b></td><td>The Spinward Marches</td></tr><tr style="background-color:#DDDDFF"><td class='padded' align='right' width='100'><b>Author</b></td><td><a href="http://index.rpg.net/display-search.phtml?key=contributor&value=Martin%2BDougherty&sort=system">Martin Dougherty</a></td></tr><tr style="background-color:#BBBBFF"><td class='padded' align='right' width='100'><b>Book Type</b></td><td>Background: Setting</td></tr><tr style="background-color:#DDDDFF"><td class='padded' align='right' width='100'><b>Genre</b></td><td>Science Fiction</td></tr><tr style="background-color:#BBBBFF"><td class='padded' align='right' width='100'><b>Setting</b></td><td><a href="http://index.rpg.net/display-search.phtml?key=background&value=Traveller&sort=system">Traveller</a> (Aramis Subsector; Cronor Subsector; Darrian Subsector; District 268; Five Sisters Subsector; Glisten Subsector; Jewell Subsector; Lanth Subsector; Lunion Subsector; Mora Subsector; Querion Subsector; Regina Subsector; Rhylanor Subsector; Spinward Marches; Sword Worlds Subsector; Trin's Veil Subsector; Vilis Subsector; Classic Era)</td></tr>
  13.  
  14.   </table>
  15. </div>
  16.  
And here's the styles of note:

Expand|Select|Wrap|Line Numbers
  1. .boxLined { background-color: #DDDDFF;
  2.        padding: 3px;
  3.        border: solid 2px #663399; }
  4.  
  5. .boxWide { width: 100%;
  6.            border-spacing: 0px; }
  7.  
  8. .padded { padding: 4px; }
  9.  
How can I make that table and that float play together nicely?
Jul 22 '09 #1
2 8182
hsriat
1,654 Recognized Expert Top Contributor
Put both elements in divs. Give the receptive properties of the elements to the containing divs instead of the elements themselves. And then also make table width 100%.
Jul 22 '09 #2
shannona
3 New Member
Sadly, that doesn't change anything, at least not in Firefox.

I'm just going to have to use a table for the top level layout instead of divs, as far as I can tell.

Nonetheless, thanks for the suggestion.
Jul 23 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1648
by: Martin | last post by:
Hi I'm having trouble with the script below that it just won't do a correct ORDER BY for a date field. When executing the two SELECT TOP statements on their own the records are sorted correctly but when wrapped in the main statement, the ORDER BY is just ignored. Tried to play around with the script but with no luck. Script is for paging, in this case, select all records meeting criteria, order and select Top 25 to display on first...
6
7437
by: MLH | last post by:
I've followed the instructions found on Microsoft's site... http://support.microsoft.com/default.aspx?scid=kb;en-us;149119&Product=acc97 Here are those instructions... To play and record sounds, follow these steps: Create the following new table in Design view: Table: Messages ----------------------- Field Name: Message Data Type: OLE Object
1
2510
by: Megan | last post by:
quick summary: i'm having problems trying to group fields in a report in order to calculate percentages. to calculate percentages, i'm comparing the results from my grouped fields to the totals. first, let me say that this is a really long post. i wasn't sure how much information/ background to provide, so i thought more was better than less. i tried to delineate certain areas so that it would be easy to peruse my posting and find...
3
1255
by: shil | last post by:
Can I have both 1.1 and 2.0 frameworks installed on same machine? I have 2005 already, for some reason I had to install 2003. When I try to create a new project in 2003, I get an error as below: "Visual Studio could not identify the version of ASP.NET oon the Web Server. The Web Server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/WebApplication1'. 'HTTP/1.1...
0
5576
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
16
3519
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for renaming the duplicate records? My thinking was to take the results of the duplicate query, and somehow have it number each line where there is a duplicate (tried a groups query, but "count" won't work), then do an update query to change the duplicate to...
14
5550
by: Jim Langston | last post by:
The output of the following program is: 1.#INF 1 But: 1.#INF 1.#INF was expected and desired. How can I read a value of infinity from a stream?
17
6810
by: D'Arcy J.M. Cain | last post by:
I'm not sure I follow this logic. Can someone explain why float and integer can be compared with each other and decimal can be compared to integer but decimal can't be compared to float? True True False This seems to break the rule that if A is equal to B and B is equal to C then A is equal to C.
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.