Closed Bug 225019 Opened 21 years ago Closed 21 years ago

width="0*" not respected in either <col> or <td> elements

Categories

(Core :: Layout: Tables, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 32841

People

(Reporter: bo, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 Firebird/0.7
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 Firebird/0.7

According to the HTML 4.01 specs
(http://www.w3.org/TR/html4/struct/tables.html#h-11.2.4) one can specify width
to be "0* (zero asterisk) which means that the width of the each column in the
group should be the minimum width necessary to hold the column's contents.".
Examples further down indicate that this applies to individual col elments, as
well. However it appears that the width of the first column, as rendered by
Gecko is somewhat proportional to the total width of the table if the first cell
seen is very wide. In the attached example you can see three tables. The width
of the first table is artificially increased by a long first cell, spanning
accross 3 columns. As a result the first cell with width="0*" is relatively
wide. The second table has a minimum width and a shorter first multi-column
cell. This results in a shorter first cell with width="0*". Finally,
artificially increasing with table width by giving it width attribute has no
impact on the width of the fist cell. Thus it seems that the width of the first
multi-column cell has impact on the remaining first column cells.

Reproducible: Always

Steps to Reproduce:
1. Load the attached HTML and observe the width of the cell with # and 1.

Actual Results:  
The width of the first cell is proportional to the width of the first
multi-column cell.

Expected Results:  
The width of the first cell should always take the minmum necessary space.

Sample HTML:

<html>
<body>

<table border="1">
<col width="0*">
<col>
<col>

<thead>
<tr>
  <td colspan="3" nowrap>
    <b>A long header that stretches the first column wider than it should be</b>
  </td>
</tr>
<tr>
  <td width="0*">#</td>
  <td>User ID</td>
  <td>Full Name</td>
</tr>
</thead>

<tbody>
<tr>
  <td width="0*">1. </td>
  <td>user</td>
  <td>Joe Smith</td>
</tr>
</tbody>
</table>

<table border="1">
<col width="0*">
<col>
<col>
<thead>
<tr>
  <td colspan="3" nowrap>
    <b>Plain table, narrow td, narrow first column</b>
  </td>
</tr>
<tr>
  <td width="0*">#</td>
  <td>User ID</td>
  <td>Full Name</td>
</tr>
</thead>
<tbody>
<tr>
  <td width="0*">1. </td>
  <td>user</td>
  <td>Joe Smith</td>
</tr>
</tbody>
</table>

<table border="1" width="600">
<col width="0*">
<col>
<col>
<thead>
<tr>
  <td colspan="3" nowrap>
    <b>Wide table, narrow td, narrow first column</b>
  </td>
</tr>
<tr>
  <td width="0*">#</td>
  <td>User ID</td>
  <td>Full Name</td>
</tr>
</thead>
<tbody>
<tr>
  <td width="0*">1. </td>
  <td>user</td>
  <td>Joe Smith</td>
</tr>
</tbody>
</table>

</body>
</html>
Note that "0*" is not supposed to work for <td> elements...

Column balancing should probably skip over columns with "0*" widths when
allocating leftover space.
I believe this is a dupe.

*** This bug has been marked as a duplicate of 32841 ***
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: