Closed
Bug 30418
Opened 25 years ago
Closed 25 years ago
Creating a table header/footer prevents display of first tbody row
Categories
(Core :: DOM: Core & HTML, defect, P2)
Core
DOM: Core & HTML
Tracking
()
VERIFIED
FIXED
M18
People
(Reporter: taras.tielkes, Assigned: karnaze)
References
Details
(Keywords: testcase, Whiteboard: [nsbeta3+])
Attachments
(1 file)
1.98 KB,
text/html
|
Details |
(This one is probably related to 26178, but the code is Dom1 javascript only)
Building a table through DOM1:
-------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN style
http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script>
window.onload = createTable;
function createTable()
{
var oTable = document.createElement("table");
document.body.appendChild(oTable);
oTable.appendChild(document.createElement("tbody"));
/* // THead creation block
var oTHead = oTable.createTHead();
var oRow = oTHead.insertRow(0);
for(col=0;col<8;col++)
{
var oCell = oRow.insertCell(col);
var cellValue = document.createTextNode("h" + col);
oCell.appendChild(cellValue);
}
*/
/* // TFoot creation block
var oTFoot = oTable.createTFoot();
var oRow = oTFoot.insertRow(0); // create table footer row
for(col=0;col<8;col++)
{
var oCell = oRow.insertCell(col);
var cellValue = document.createTextNode("f" + col);
oCell.appendChild(cellValue);
} */
for(row=0;row<1;row++) // ask for just 1 row
{
var oRow = oTable.tBodies[0].insertRow(row);
for(col=0;col<8;col++)
{
var oCell = oRow.insertCell(col);
var newValue2 = document.createTextNode("r" + row + "c"
+ col);
oCell.appendChild(newValue2);
}
}
oTable.border = 4;
var str = "";
str += ".rows.length: " + oTable.rows.length + "\n";
//str += ".tHead.rows.length: " + oTable.tHead.rows.length + "\n";
//str += ".tFoot.rows.length: " + oTable.tFoot.rows.length + "\n";
str += ".tBodies.length: " + oTable.tBodies.length + "\n";
str += ".tBodies[0].rows.length: " + oTable.tBodies[0].rows.length
+ "\n";
//alert(str);
}
</script>
</head>
<body>
</body>
</html>
-------------------------------------------------------------------
Above script will make one table row.
Uncommend the tfoot and/or thead creation block and the added tbody row will
disappear. Adding 2 tbody rows will show only 1, et cetera.
Reporter | ||
Comment 1•25 years ago
|
||
The table row *is* created, as the alert() at the end of the script will show.
Adding a thead, tfoot, and 1 tbody row will give a result of "3" when looking
in "oTable.tBodies[0].rows.length".
Moving the "document.body.appendChild(oTable);" statement to the end of the
script block (e.g. to the place of the commented-out "alert") will fix the
display problems. Hope this helps track the problem a bit.
Comment 2•25 years ago
|
||
t.r.tiekes@zap.a2000.nl - is this still not working in recent Mozilla builds?
Gerv
Reporter | ||
Comment 3•25 years ago
|
||
Doesn't work in Netscape 6 beta 1.(WinNT)
Doesn't work in today's build. (WinNT)
All other bugs that are displayed by the included sample still show (first
column is drawn last et cetera)
Updated•25 years ago
|
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Comment 4•25 years ago
|
||
Since Vidur is on sabbatical I'm taking this one...
Assignee: vidur → jst
Status: ASSIGNED → NEW
Comment 5•25 years ago
|
||
Comment 6•25 years ago
|
||
Accepting bug, aiming for M17.
Status: NEW → ASSIGNED
OS: Windows NT → All
Hardware: PC → All
Target Milestone: --- → M17
Reporter | ||
Comment 8•25 years ago
|
||
Johnny Stenback, there is a way to modify the (JavaScript) code that will show
the header/footer.
Basically, if I stay away from manualy creating a TBODY, but insert rows
directly into the table, things work.
The other requirement for this to work is that the table rows insertion takes
place *before* the THEAD/TFOOT insertion. The testcase I'm talking about is
attached to this bug:
http://bugzilla.mozilla.org/show_bug.cgi?id=30420
Perhaps comparing the code paths and tracing the two different testcases can
help you find the bug. If you need more testcases or other assistance, just
yell.
Comment 9•25 years ago
|
||
Nominating for nsbeta3, I think I even had a partial fix for this waaaay back,
can't seem to find it right now tho.
Comment 10•25 years ago
|
||
correctness of DOM1 implementation. Important to be able to generate tables
programmatically through DOM1.
Keywords: correctness
Comment 11•25 years ago
|
||
This bug has been marked "future" because the original netscape engineer working
on this is over-burdened. If you feel this is an error, that you or another
known resource will be working on this bug,or if it blocks your work in some way
-- please attach your concern to the bug for reconsideration, but do not clear
the nsbeta3- nomination.
Comment 12•25 years ago
|
||
Inserting the tbody *before* the thead insertion works. However, the width of
the table cells does not reflow which is should if a cell in the head row is
wider than any cells in that row. I know this can be set with css, but it would
be nice if it is not going to be fixed to at least have the table reflow after
adding a thead last to reflect wider headings if necessary.
Comment 13•25 years ago
|
||
Reassigning and removing Future milestone and nsbeta3-, karnaze, please look
into the reflow problem and target this bug appropriately. Feel free to give
this back to me once the reflow problem is dealt with. Thanks!
Assignee: jst → karnaze
Status: ASSIGNED → NEW
Whiteboard: [nsbeta3-]
Target Milestone: Future → ---
Updated•25 years ago
|
Target Milestone: --- → M18
Comment 15•25 years ago
|
||
PDT reviewing P2 bugs, but we can't make a judgement on the severity/criticality
of this bug. Chris or Vidur, could you make a comment?
Assignee | ||
Comment 16•25 years ago
|
||
Fixed.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 17•25 years ago
|
||
Verified:
2000-09-28-09-MN6 : Windows
2000-09-26-04-M18 : Mac
2000-09-28-10-MN6 : Linux
Status: RESOLVED → VERIFIED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•