Closed Bug 18839 Opened 25 years ago Closed 25 years ago

toggling style.display = 'none'/'table-row' works only once

Categories

(Core :: Layout: Tables, defect, P3)

Other
Other
defect

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: martin.honnen, Assigned: karnaze)

References

()

Details

Attachments

(1 file)

I have some code which on button click sets the
.style.display
value of even rows in a table alternatively to
'table-row'/'none'
Setting to 'none' and back to 'table-row' is visually executed once afterwards
the screen display of the rows remains visible though the javascript/dom value
gets set to 'none'.
To check the bug press the button three times. The third press has not the
desired effect.


< SCRIPT> var visible = true;
function toggleRows (tid) {
  var table =
document.getElementById(tid);
  for (var r = 1; r < table.rows.length; r += 2)

   table.rows[r].style.display = visible ? 'none' : (navigator.appName ==
'Microsoft Internet Explorer') ? 'inline' : 'table-row';
  visible = !visible;
}

< /SCRIPT>< /HEAD>< BODY>< BUTTON ONCLICK="toggleRows('aTable');"> toggle rows< /BUTTON
>< BUTTON
ONCLICK="alert(document.getElementById('aTable').rows[1].style.display);"> show
rows[1].style.display
< /BUTTON>< BR>< TABLE ID="aTable">< TR BGCOLOR="lime"><
TD> Kibology
< /TD>< TD> for
< /TD>< TD> all
< /TD>< /TR>< TR BGCOLOR="yellow">< TD
> All
< /TD>< TD> for
< /TD>< TD> Kibology
< /TD>< /TR>< TR BGCOLOR="lime">< TD> Kibology

< /TD>< TD>
Attached file bug demo
In an attempt to get my bug list in order again, marking all the bugs I have
currently as ASSIGNED.
Component: DOM Level 2 → HTMLTables
Assignee: vidur → karnaze
Status: ASSIGNED → NEW
This is a layout bug and not a DOM bug so changing component
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → WORKSFORME
However, the page seems to be working very well for me with today's build so I'm
marking this WORKSFORME
 The given page with .style.display works fine for me on build ID : 2001122603
Marking verified
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: