473,382 Members | 1,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Table Width = 100% In FireFox Not Working

74
Hi there!


I'm developing a "scrollable table".
At first I started using CSS. It worked pretty well until I found a bug that happens when placing this table into a tabbing control...

So I decided to develop 2 tables...one for the header information and one for the body. I simply placed the body into a <div> with style="overflow:auto".

I've set the header table to be 100%...expecting it to span 100% of the parent.
This works fine in other browsers but for some reason FireFox does not do this.

I seem to be the only person with this problem...
Normally people are complaining that the width is larger than the parent container...

In my case the width is set to the the size of the content of its cells...it is Much smaller than the parent container and so it doesn't match up properly with the content cells...

Any suggestions on how to correct this problem would be appreciated.

The following is the html code that I am using.

Thanks in advance!

Expand|Select|Wrap|Line Numbers
  1. <div style="width:350px" class="ScrollContainer">
  2.        <table cellspacing="0px" style="display:inline; text-align:center;width:100%; margin:0;padding:0;" width="100%">
  3.                 <tr width="100%">
  4.                     <th align=center width="20%">Sel</th>
  5.                     <th align=center width="40%">Abc</th>
  6.                     <th align=center width="40%">Xyz</th>
  7.                 </tr>
  8.  
  9.         </table>
  10.         <div class="ScrollTable" style="height:80px; overflow:auto;">
  11.             <table id="Tbl_Content" cellspacing="0px" width="95%">
  12.                  <tbody>
  13.                      <tr>
  14.                        <td width="20%"><input type="checkbox" name="MyThingySelected" checked="checked"  value="Abc_1" /></td>
  15.                        <td width="40%">Abc1</td>
  16.                        <td width="40%">Xyz1</td>
  17.                    </tr>
  18.  
  19.                    <tr>
  20.                        <td width="20%"><input type="checkbox" name="MyThingySelected" checked="checked"  value="Abc_2" /></td>
  21.                        <td width="40%">Abc2</td>
  22.                        <td width="40%">Xyz2</td>
  23.                    </tr>
  24.  
  25.                    <tr>
  26.                        <td width="20%"><input type="checkbox" name="MyThingySelected" checked="checked"  value="Abc_3" /></td>
  27.                        <td width="40%">Abc3</td>
  28.                        <td width="40%">Xyz3</td>
  29.                    </tr>
  30.  
  31.                    <tr>
  32.                        <td width="20%"><input type="checkbox" name="MyThingySelected" checked="checked"  value="Abc_4" /></td>
  33.                        <td width="40%">Abc4</td>
  34.                        <td width="40%">Xyz4</td>
  35.                    </tr>
  36.  
  37.                    <tr>
  38.                        <td width="20%"><input type="checkbox" name="MyThingySelected" checked="checked"  value="Abcx_1" /></td>
  39.                        <td width="40%">Abcx1</td>
  40.                        <td width="40%">Xyzx1</td>
  41.                    </tr>
  42.  
  43.                    <tr>
  44.                        <td width="20%"><input type="checkbox" name="MyThingySelected" checked="checked"  value="Abcx_2" /></td>
  45.                        <td width="40%">Abcx2</td>
  46.                        <td width="40%">Xyzx2</td>
  47.                    </tr>
  48.  
  49.                    <tr>
  50.                        <td width="20%"><input type="checkbox" name="MyThingySelected" checked="checked"  value="Abcx_3" /></td>
  51.                        <td width="40%">Abcx3</td>
  52.                        <td width="40%">Xyzx3</td>
  53.                    </tr>
  54.  
  55.                    <tr>
  56.                        <td width="20%"><input type="checkbox" name="MyThingySelected" checked="checked"  value="Abcx_4" /></td>
  57.                        <td width="40%">Abcx4</td>
  58.                        <td width="40%">Xyzx4</td>
  59.                    </tr>
  60.                 </tbody>
  61.             </table>
  62.         </div>
  63.  
  64. </div>
Nov 29 '07 #1
4 9315
lilOlMe
74
..~--==bump==--~...

-LilOlMe
Dec 7 '07 #2
drhowarddrfine
7,435 Expert 4TB
You have the table set as 'inline'. Inline elements cannot have a width. IE, and whatever 'other' browsers, are working incorrectly.

Just remove the 'display:inline' and it will work.
Dec 7 '07 #3
improvcornartist
303 Expert 100+
It appears that the display:inline in the first table style is causing your header row to not span the width of the div. You could try removing that from the style and see what that does.

Edit:
Apparently I answered at the same time as drhowarddrfine. Sorry for the double answer.
Dec 7 '07 #4
lilOlMe
74
I can't believe I over looked the inline setting!
I learned my lesson with inline elements months ago.
>>blush<<
Sometimes I can just be so...
Blind

Thanks for your help!
Removing the inline style setting resolved the problem.

-LilOlMe
Dec 17 '07 #5

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

Similar topics

8
by: starritt | last post by:
I have the following style: ..content {position: absolute; right: 10px; left: 170px; top: 135px; padding-left: 0px; color: #15447c;} ..content table {width: 100%; background: BLUE; color:...
4
by: Alex Meier | last post by:
I have the following problem: I need a simple, tabular layout in a webshop. - left column: navigation column with approx. 170px width - right column: content area the goal: the left column...
2
by: Logan | last post by:
i've added a data grid to an aspx form, & i've noticed that the width of the grid is fixed. I want to be able to set the width to fit the entire width of the browser. Such as done in classic...
2
by: James Frayne | last post by:
Hi, I am trying to integrate phpBB into my existing site design. I am doing this simply by pasting fragments of my HTML into the phpBB templates. This works fine in Firefox and Opera but the...
3
by: VK | last post by:
Stock in one strange problem equal to both FF and IE. With form width set to 100% the right border of form goes hell knows where behind the screen. Is there a way to tell reliably to form to...
0
by: mephraim | last post by:
I have a page at (view in IE): http://rmc2.dev.leepfrog.com/ie_fix_me/index.html that has an image floated right outside of a main content div that looks like: <img src="blah" style="float:...
16
by: Tantale | last post by:
I used this serviec to check my webpage http://www.jmrw.com/Abroad/Barcelone/index.htm Made with Dreamweaver 8. The result is 206 errors, most of them "end tag omitted, but OMITTAG NO was...
16
by: Charles A. Landemaine | last post by:
I set a table with 100% width to occupy all available space, but in IE7 it uses more than that, it uses 100% of the page width instead of 100% of the table container. Could you test the page in IE7...
1
dmjpro
by: dmjpro | last post by:
Here is my HTML code <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td class="header_inactivated"...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.