CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005
    Posts
    69

    [RESOLVED] DOM Table Caption in IE 6

    Code:
    function createTitleUrlTable() {
    	var newtable = document.createElement("table");
    	newtable.border = "0";
    
    	for (var i = 0; i < 4; i++) {
    		newtable.insertRow(i);
    		newtable.rows[i].insertCell(0);
    		newtable.rows[i].insertCell(1);
    		newtable.rows[i].cells[0].width = "20%";
    	}
    
    	newtable.rows[0].cells[0].innerHTML = title_HTML;
    	newtable.rows[0].cells[1].innerHTML = title_input;
    	newtable.rows[1].cells[0].innerHTML = url_HTML;
    	newtable.rows[1].cells[1].innerHTML = url_input;
    	newtable.rows[2].cells[0].innerHTML = category_HTML;
    	newtable.rows[2].cells[1].innerHTML = category_select;
    	newtable.rows[3].cells[0].colSpan = 2;
    
    	return newtable;
    }
    
    var newtable = createTitleUrlTable();
    newtable.caption = document.createElement("caption");
    In IE 6, the script execution stops at the last line. It is ok in firefox. How to fix it?
    ~Donotalo()

  2. #2
    Join Date
    Aug 2005
    Posts
    69

    Re: DOM Table Caption in IE 6

    Solved by using createCaption() function.
    ~Donotalo()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured