We have developed web application using c#.net and java script grids are not displaying in IE 8 and above
Here is the code of javascript for generating table(grid) header
tableid is number of rows and Title is Grid header name
function GenerateTableHeader(TableId,Title)
{
if(document.getElementById(TableId).rows.length>0) //0-indicates No rows in table
{
return false;
}
var tblrow = document.createElement("TR");
tblrow.setAttribute("name","row1");
tblrow.setAttribute("Id","row1");
var TitleDesc=document.getElementById(Title).value;
var TitleColumns=TitleDesc.split('|');
for(i=0;i<TitleColumns.length;i++)
{
//Apply Style for table row heading
var tblCell = document.createElement("<TD class=\"Gridheading\">");
tblCell.innerHTML='<b>' + TitleColumns[i] + '</b>';
tblCell.setAttribute ("align","center");
//tblCell.setAttribute ("width","7%");
tblrow.appendChild(tblCell);
tblCell = null;
}
var tblItemBody=document.getElementById(TableId).getElementsByTagName("tbody")[0]
tblItemBody.appendChild(tblrow);
}
In IE 6 and 7 grid is displaying.I need to display the grid in IE 8 and above
please help me ….. Thanks in advance
try this