Closed Bug 198886 Opened 21 years ago Closed 21 years ago

table tr display problem on changing display style block none block none ...

Categories

(Core :: Layout: Tables, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 97506

People

(Reporter: victor.chevalier, Unassigned)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312

If I change the display style of the tr elements of a table from block to none
several times, there is a blank line which is inserted at the start of the table.

Reproducible: Always

Steps to Reproduce:
1. execute the following code

<html>
<head><title>Test</title></head>
<body>
<form method="post" action="./main">
<script type="text/javascript">
function setDisplay(mode) {
	var trs = window.document.getElementsByName("tr");
	for (var i = 0; i < trs.length; ++i) {
		trs[i].style.display = mode;
	}
}
</script>
<table>
<tbody>
<tr name="tr"><td>Cellule 1</td></tr>
<tr name="tr"><td>Cellule 2</td></tr>
<tr name="tr"><td>Cellule 3</td></tr>
<tr name="tr"><td>Cellule 4</td></tr>
</tbody>
</table>
<p>
	<input type="button" value="Hide" onclick="setDisplay('none')"/>
	<input type="button" value="View" onclick="setDisplay('block')"/>
</p>
</form>
</body>
</html>

Actual Results:  
The table scroll down the screen

Expected Results:  
The table should stay on the top of the screen
INVALID. the correct style for tr is "display: table-row" (supported in Opera,
not in IE IIRC) and you're probably creating some "anonymous content" by what
you're doing. See <URL:http://www.w3.org/TR/REC-CSS2/tables.html#anonymous-boxes>.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
That's right. Sorry for the annoyance.
Status: RESOLVED → VERIFIED
*** Bug 209297 has been marked as a duplicate of this bug. ***
Reopening this bug until someone who understands the CSS2 rules on how to handle
unexpected display types in tables can really evaluate whether it's valid or not
(or duplicate of another bug we have).

That said, using the correct types or "" is an easy workaround for the author.
Status: VERIFIED → UNCONFIRMED
Resolution: INVALID → ---
Going from one state to another and back to the original state should leave the
page the same.  That's not what's happening.

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

Attachment

General

Created:
Updated:
Size: