Friday, September 25, 2009

jQuery, attr function, colspan and IE7

For some reason IE& does not apply attributes from attr function to DOM elements in a case when you want to test colspan on some table cell. Colspan is rendered but it looks like IE refuses to apply it. There is a hack which makes wrapper around problem. Don't ask me why, but it works.

Instead of $("#MediaTitleCell").attr("colspan", 4) you should type code from following snippet:


$("#MediaTitleCell" + queueID).each(function() {
this.colSpan = 4;
});

As I say, don't ask me why but it works this way.

Cheers.

No comments: