Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by tj cioffe on May 12, 2009 12:26
open dhtmlx forum
XHTML doctype and IE7

hi there,

when using XHTML Transitional doctype instead of HTML 4.01 Transitional, column headings do not line up properly in IE7, using below code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>
        Test
    </title>
    <link rel="stylesheet" media="all" href="dhtmlx.css" />
    <link rel="stylesheet" media="all" href="dhtmlx_skins.css" />
    <script src="dhtmlx.js" type="text/javascript"></script>
    <script type="text/javascript">
    /*<![CDATA[*/
        var mygrid;

        //function to initlize the grid
        function doInitGrid(){
            //create grid object
            mygrid = new dhtmlXGridObject('mygrid_container');

            mygrid.setImagePath(../imgs/");
            mygrid.setHeader("Sales,Book Title Book Title Book Title Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication");
            mygrid.setInitWidths("80,*,100,80,40,40,40,80")
            mygrid.setColAlign("center,left,left,right,center,left,center,center")
            mygrid.setColTypes("ed,ed,ed,price,ch,co,ro,ro");

            mygrid.setColSorting("int,str,str,int,str,str,str,date")
            mygrid.setColumnColor("white,#d5f1ff,#d5f1ff")
            mygrid.enableMultiselect(true);
            mygrid.init();

            mygrid.loadXML("grid.xml");
        }
    /*]]>*/
    </script>
</head>
<body class="contentMain" onload="doInitGrid()">

<div id="mygrid_container" width="660px" height="250px" style="background-color:white;overflow:hidden"></div>

</body></html>

Changing the doctype above to HTML 4.01 Transitional makes the columns and the header line up properly. The above code works fine in IE8, FF3, and Chrome; just not IE7 (or IE8 in "compatibility view") The grid.xml is the same one used in the autowidth example for dhtmlxgrid... am using dhtmlxSuite 2.1.

Any suggestions?

Answer posted by dhxSupport on May 13, 2009 03:58
We cannot reproduce this issue locally. Could you please send us sample or screenshot where this issue occurs.
Answer posted by tj cioffe on May 13, 2009 05:10
please see attached file.  grid_good.htm lines up properly and uses HTML 4.01 Transitional doctype.  grid_bad.htm is the same as grid_good, except it uses XHTML 1 Transitional and does not line up properly.  Problem only occurs in IE7 / IE8 in Compatibility View / FF using IEtab.
Answer posted by dhxSupport on May 13, 2009 06:03
Issue was confirmed. Fixed files will be send you by email