Bug 15022

Summary: Cell width can't be changed when the table is using table-layout:fixed
Product: WebKit Reporter: James <jimmyps.ong>
Component: TablesAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: mitz, tom
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Testcase none

Description James 2007-08-20 10:26:00 PDT
Try to click the button of the following simple html page. The script should simply change the first cell's width to 50px (it worked properly in IE/Gecko/Opera). But it didn't work in Safari.

<html>
<head>
    <title>Untitled Page</title>
</head>
<body>
    <script type="text/javascript">
    
        function SetWidth()
        {
            var cell = document.getElementById("a1");
            cell.style.width = "50px";
            cell.width = "50";
            
            alert("Cell 1's width should be 50px by now.. but it isn't :(");
        }
    </script>
    <table id="tb1" border="1" style="width: 500px; table-layout: fixed">
        <tr>
            <td id="a1" style="width: 100px">
                Cell 1</td>
            <td id="a2" style="width: 100px">
                Cell 2</td>
            <td id="a3" style="width: 300px">
                Cell 3</td>
        </tr>
    </table>
    <button onclick="SetWidth()">Change Cell 1 width to 50px</button>
</body>
</html>
Comment 1 James 2007-08-20 10:28:46 PDT
Created attachment 16032 [details]
Testcase
Comment 2 Tom Brown 2007-08-27 14:47:06 PDT
This appears to have been fixed sometime between nightlies r25168 and r25239
Comment 3 mitz 2007-08-27 14:58:59 PDT
Fixed by Beth in <http://trac.webkit.org/projects/webkit/changeset/25224>.