473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Dynamically created Tables

Hi,

I have code that is creating tables dynamically. For some reason
unbeknown to me, the attributes 'rowspan' and 'colspan' are being
ignored in IE 6.02 on XP SP2

In Firefox the behaviour is as expected.

The code I am using is as follows:

newTD = document.createElement("td")
newTD.setAttribute('width', '139')
newTD.setAttribute('rowspan', '2')
newTD.setAttribute('align', 'left')
newTD.setAttribute('vAlign', 'top')
newTD.setAttribute('class', 'AllBorders')
newTD.innerHTML = " "

newRow.appendChild(newTD)
newTD = document.createElement("td")

newTD.setAttribute('width', '150')
newTD.setAttribute('rowspan', '2')
newTD.setAttribute('align', 'left')
newTD.setAttribute('vAlign', 'top')
newTD.setAttribute('class', 'AllBorders')
newTD.innerHTML = "Centre"

newRow.appendChild(newTD)
newTD = document.createElement("td")

newTD.setAttribute('width', '225')
newTD.setAttribute('colspan', "3")
newTD.setAttribute('align', 'left')
newTD.setAttribute('vAlign', 'top')
newTD.setAttribute('class', 'AllBorders')
newTD.innerHTML = "Bandwidth (KB/s)"

newRow.appendChild(newTD)
newTD = document.createElement("td")

newTD.setAttribute('width', '283')
newTD.setAttribute('colspan', '3')
newTD.setAttribute('align', 'left')
newTD.setAttribute('vAlign', 'top')
newTD.setAttribute('class', 'AllBorders')
newTD.innerHTML = "Support"

newRow.appendChild(newTD)
tBody.appendChild(newRow);

Can anyone give me any tips

Thanks in advance
Jul 23 '05 #1
4 7668

"Stuart Perryman" <st****@seccus.com> wrote in message
news:af**************************@posting.google.c om...
Hi,

I have code that is creating tables dynamically. For some reason
unbeknown to me, the attributes 'rowspan' and 'colspan' are being
ignored in IE 6.02 on XP SP2

[code snipped]

The reason could be anywhere in the table, and you're only showing one row.
Can you provide a URL to the whole thing?

Jul 23 '05 #2


Stuart Perryman wrote:

I have code that is creating tables dynamically. For some reason
unbeknown to me, the attributes 'rowspan' and 'colspan' are being
ignored in IE 6.02 on XP SP2
You would better ask such questions in comp.lang.javascript.

newTD = document.createElement("td") newTD.setAttribute('rowspan', '2')


IE enforces its very own casing of attribute names when scripting them
so you need
newTD.setAttribute('rowSpan', '2')
You can find the docs about the attribute/property names IE uses here:
<http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties.asp>

Most regulars in comp.lang.javascript will suggest to use the HTML DOM
with properties
newTD.rowSpan = 2;
anyway, and there the casing matters too but is consistently in browsers.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #3
On 5 Jan 2005 09:13:03 -0800, st****@seccus.com (Stuart Perryman)
wrote:
I have code that is creating tables dynamically. For some reason
unbeknown to me, the attributes 'rowspan' and 'colspan' are being
ignored in IE 6.02 on XP SP2


That's two questions, not one.

Store the generated HTML and look at it. Does it even contain the
attributes you expect ? (a JavaScript problem)

If they are there, but the browser isn't rendering it (a HTML
problem), then edit the static HTML until it does work. Then worry
about how to change your generator to make this HTML.
--
Smert' spamionam
Jul 23 '05 #4
Martin Honnen <ma*******@yahoo.de> wrote in message news:<41***********************@newsread2.arcor-online.net>...
Stuart Perryman wrote:

I have code that is creating tables dynamically. For some reason
unbeknown to me, the attributes 'rowspan' and 'colspan' are being
ignored in IE 6.02 on XP SP2

You would better ask such questions in comp.lang.javascript.
newTD = document.createElement("td")
newTD.setAttribute('rowspan', '2')

IE enforces its very own casing of attribute names when scripting them
so you need
newTD.setAttribute('rowSpan', '2')
You can find the docs about the attribute/property names IE uses here:
<http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties.asp>
Most regulars in comp.lang.javascript will suggest to use the HTML DOM
with properties
newTD.rowSpan = 2;
anyway, and there the casing matters too but is consistently in browsers.

Hi Martin,

This was exactly my problem.

Thanks to all who replied. I also found out that not only is case an
issue but the attribute name as well. Case in point attribute
'class'->firefox is classname in IE.

Stuart
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chris Powell | last post by:
I am using Excel/Access 2000 and have two large Excel files (25,000 rows each) that I wish to create linked tables in Access rather than importing into Access. The two source Excel files change...
1
by: Ed West | last post by:
Hi, I am dynamically creating Comboboxes and putting them in a panel. However, they are all referencing the same object! When I change one, then all of them change. How can I make it so it...
7
by: who be dat? | last post by:
I need some help here. I'm creating a list on a page where the list is created from a dataset with two tables linked with a datarelation. The first table is a list of groups while the second...
2
by: buran | last post by:
Dear ASP.NET Programmers, I have a HTML table (running as server control with the control ID: tblInsertSP). The table has 16 rows with textboxes. Depending on the value of the ddlSPType, which...
2
by: Chad | last post by:
I have a problem that I am desperate to understand. It involves dynamically adding controls to a Table control that is built as a result of performing a database query. I am not looking to...
8
by: utterberg | last post by:
Hi I'm adding two dropdownlist in my webform by clicking a button. I fill the first dropdown with some values from my DB and the other one when I choose from the first dropdown. But since theese...
0
by: Syoam4ka | last post by:
My project is about jewellery. I have devided my jewelery into main types, which each one of them has sub types, and each one those sub types has the jewellery. I have a tabcontainer. It includes...
5
by: davidson1 | last post by:
Hai Friends, I have the following code for Dynamically Created Tables, I have created the panel in the webform....... Dim tab5 As New Table Dim row1 As New TableRow Dim cell1 As...
2
by: ssmith147 | last post by:
Hi, I'm somewhat familiar with access and vb programming (I can read someone else's code, for the most part), but I'm still very green when it comes to creating solutions for my own needs. I'm...
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.