Показать сообщение отдельно
  #7 (permalink)  
Старый 06.05.2008, 23:36
Аватар для scuter
Профессор
Отправить личное сообщение для scuter Посмотреть профиль Найти все сообщения от scuter
 
Регистрация: 14.03.2008
Сообщений: 169


в опере заработало,
function addComponent(_obj, _arr)
{
	for(var k in _arr)
	{
		if(typeof _arr[k].tagname == 'string')
		{
			var tag = _arr[k].tagname;
			var Component = document.createElement(tag);
			//alert(typeof Component);
			if(typeof _arr[k].attributes == 'object')
			{
				var attributes = _arr[k].attributes;
				for(var d in attributes)
				{
					if(typeof attributes[d] == 'string')
					{
						Component[d] = attributes[d];
					}
				}
			}
			if(typeof _arr[k].innerHTML == 'string')
			{
				Component.innerHTML = _arr[k].innerHTML;
			}
			var domComponent = _obj.appendChild(Component);
			if(typeof _arr[k].Child == 'object')
			{
				addComponent(domComponent, _arr[k].Child);
			}
		}
	}
}
function init()
{
	var mx = [{
		tagname:'table',
		attributes:{
			width:'100%',
			height:'600',
			bgColor:'#0000CC'
		},
		Child:[{
			tagname:'tr',
			Child:[{
				tagname:'td',
				innerHTML:'text text text text text text '
			},{
				tagname:'td',
				innerHTML:'text text text text text text '
			},{
				tagname:'td',
				innerHTML:'text text text text text text '
			},{
				tagname:'td',
				innerHTML:'text text text text text text '
			}]
		},{
			tagname:'tr',
			Child:[{
				tagname:'td',
				innerHTML:'text text text text text text '
			},{
				tagname:'td',
				innerHTML:'text text text text text text '
			},{
				tagname:'td',
				innerHTML:'text text text text text text '
			},{
				tagname:'td',
				innerHTML:'text text text text text text '
			}]
		}]
	}];
	addComponent(document.body, mx);
}

в IE таблица вроди как существует, но её почему то не видно

Последний раз редактировалось scuter, 06.05.2008 в 23:43. Причина: косяк
Ответить с цитированием