473,760 Members | 10,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Table width error???


Am I misunderstandin g the CSS specifications or is Firefox (version 1.0.6)
(and Opera) doing the wrong thing?

It appears that Firefox 1.0.6 includes the border in width calculations
for tables but not in height calculations.

Oh, and Opera version 8.02 does the same thing.

|<-->| |<-->| <------ border
|<------------>| <------ table contents
|<---------------------->| <------ width as rendered by Firefox
(*includes* border)
(it should be the width of the
contents, shouldn't it?)
+------------------------+ -----
| | <--- border
| +--------------+ | -----
| | | | ^
| | | | | <--- contents and height
| | | | v (height excludes border)
| +--------------+ | -----
| | <--- border
+------------------------+ -----
I can get a table I want to render correctly without specifying a height
and width but, in that case, the table's border is initially too small and
then redrawn with an ever-increasing size as rows are read from the HTML
and only reaches the correct size when the table is entirely read. (The
actual table is *much* larger than the example one, 32 rows and columns
with the height and width dynamically adjusted with JavaScript so only
some (9 rows and 9 columns) are visible at any given time.) I wanted to
specify the size of the visible part of the table at the start so the
border could immediately be drawn at the right size.

A portion of the HTML for an example 6-column, 2-row table with images:

....
....
<h2>No height and width specified</h2>
<table style="border:3 2px ridge #50C040;font-size: 0px; padding: 0" cellspacing="1" >
....
....
<h2>Height = 127px; width = 431px</h2>
<h3>(Height = 2 * image height + 1; Width = 6 * image width + 5)</h3>
<p>The table should be the same as above -- but isn't.</p>
<table style="border:3 2px ridge #50C040;font-size: 0px; padding: 0; height: 127px; width: 431px" cellspacing="1" >
....
....
<h2>Height = 127px; width = 495px</h2>
<h3>(Height = 2 * image height + 1; Width = 6 * image width + 5 + 64)</h3>
<p>Adding twice the width of the border to the width seems to correct the size problem
but the border size should not have had any influence on the size of the content area
of the table.</p>
<table style="border:3 2px ridge #50C040;font-size: 0px; padding: 0; height: 127px; width: 495px" cellspacing="1" >
....
....
However, Firefox's treatment of a width specifier (but not the height
specifier) seems to counter-intuitively include the border. The complete
example file (6KB):
http://www.chebucto.ns.ca/~af380/Tab...idthError.html

The first table lacks height and width for the overall table style,
the second has the width I *thought* I should use and gets rendered too
small and the third table gets rendered the size I want but I don't
think Firefox or Opera are really doing the right thing.

So, am I wrong or are both Firefox and Opera wrong?

--
``Why don't you find a more appropiate newsgroup to post this tripe into?
This is a meeting place for a totally differnt kind of "vision impairment".
Catch my drift?'' -- "jim" in alt.disability. blind.social regarding an
off-topic religious/political post, March 28, 2005
Sep 16 '05
11 3580

I have created a table in Macromedia Dreamweaver MX 2004 and published
it. In IE it looks like it does in Dreamweaver but in Firefox some
cells are too big. Please help here is the code for the table.

<table width="64" height="185" border="0" cellpadding="3"
cellspacing="3" bordercolor="#9 9CC66" bgcolor="#99CC0 0">
<tr>
<th width="52" height="24" bgcolor="#99CC3 3" scope="row"><p
align="center" class="style1"> Home</p> </th>
</tr>
<tr>
<th height="24" bordercolor="#F FFF66" bgcolor="#99CC3 3"
scope="row"><p align="center" class="style1"> About</p> </th>
</tr>
<tr>
<th height="23" bgcolor="#99CC3 3" scope="row"><di v
align="center"> <span class="style1"> Jokes</span></div></th>
</tr>
<tr>
<th height="23" bordercolor="#F FFF66" bgcolor="#99CC3 3"
scope="row"><di v align="center"> <span
class="style1"> Reviews</span></div></th>
</tr>
<tr>
<th height="23" bgcolor="#99CC3 3" scope="row"><di v
align="center"> <span class="style1"> Games</span></div></th>
</tr>
<tr>
<th height="23" bgcolor="#99CC3 3" scope="row"><di v
align="center"> <span class="style1"> Gadgets</span></div></th>
</tr>
<tr>
<th height="23" bgcolor="#99CC3 3" scope="row"><di v
align="center"> <span class="style1"> Media</span></div></th>
</tr>
</table>

The adress of the table is

http://www.btinternet.com/~psilas/Ne...pages/test.htm

Any help on this matter would be most appreciated

Thankyou :)
--
jonsey42
------------------------------------------------------------------------
jonsey42's Profile: http://www.highdots.com/forums/m1095
View this thread: http://www.highdots.com/forums/t2927492

Oct 17 '05 #11
jonsey42 wrote:
I have created a table in Macromedia Dreamweaver MX 2004 and published
it. In IE it looks like it does in Dreamweaver but in Firefox some
cells are too big. Please help here is the code for the table. <snip> http://www.btinternet.com/~psilas/Ne...pages/test.htm

Any help on this matter would be most appreciated


Could be because of the error in your styles. Firefox is probably,
correctly, ignoring it.

<http://jigsaw.w3.org/css-validator/validator?profi le=css2&warning =2&uri=http%3A//www.btinternet. com/%7Epsilas/New_Smackawhack/pages/test.htm>

--
-bts
-When motorcycling, never follow a pig truck
Oct 17 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1955
by: maceo | last post by:
I have a script that will print out the results of a table and make a calculation of a total of one of the columns. See example: <?php /* Database connection */ include(MYSQL_CONNECT_INCLUDE); /* Select all pilots */ $query = "SELECT * FROM pilots ORDER BY pilot_num ASC";
25
5196
by: kie | last post by:
hello, i have a table that creates and deletes rows dynamically using createElement, appendChild, removeChild. when i have added the required amount of rows and input my data, i would like to calculate the totals in each row. when i try however, i receive the error: "Error: 'elements' is null or not an object"
22
6430
by: Mal Ball | last post by:
I hope I have the right forum for this question. I have an existing Windows application which uses a SQL Server database and stored procedures. I am now developing a web application to use the same database. The original Update and Delete SP's all use a timestamp for concurreny checking. I am trying to use the same Update SP from my sqlDataSource but I keep getting the following error:
1
1578
by: Rahul | last post by:
Hi, I tried many option, but did not found solution. Same Validation Error showing. If I have convert one table, it can easily converted. But If I have paste another table in same file, then showing validation Error. This Error is -- =======================================================
16
3497
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record in a hidden field) I wish the user to be able to edit the data in the table, so I have extracted the records into hiddenfield, textareas, dropdown list and checkbox so that they can make changes. I named these elements as arrays and wish to run an...
12
1763
by: Lennart Anderson | last post by:
I'm having a MySQl table wih a lot of information. I want to present some main fields in a table on one page. Each record do, of course, have a unique ID. The presnted table will have one field as a linked field. I want to be able to click this link, retreive the ID information for that record and then present detailed data for that record on the next page. How do I retreive the ID? Any hints are very much appreciated. Thanks
1
7552
Merlin1857
by: Merlin1857 | last post by:
How to search multiple fields using ASP A major issue for me when I first started writing in VB Script was constructing the ability to search a table using multiple field input from a form and having the sql statement dynamically built according to the input provided by the user. I have used the method described here hundreds of times it is quick and adaptive. I generally use a frames page for the search, in this way the search is maintained...
4
2147
osward
by: osward | last post by:
I had made a table colum sortable and paging the table, following are the code // Display Event List echo "<center>"._EVENTLIST."</center><br>"; $now = Date(Y-m-d); // sort table colum if(!isset($_GET)){ $page = 1; } else {
1
16974
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot examples I found on the web. Works in IE and mozilla. http://www.imaputz.com/cssStuff/bigFourVersion.html
0
9521
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
9333
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,...
0
10107
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9945
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9900
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,...
1
7324
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
6599
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();...
1
3863
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
3
2733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.