473,320 Members | 1,876 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,320 software developers and data experts.

Dynamically created rows in table are not following the StyleSheetrules

Hi all,

I've created a table with Table Header and the table may or may not
contain any rows initially.
I've included a .css file in <head> section of my HTML script and I'm
creating rows to the table
dynamically using JavaScript (using DOM), and the problem is those
created bby DOM are not
following style sheet rules applicable for table rows and cells. But the
rows created from within
HTML script are following style sheet rules. The following is sample
which is used to create
dynamic row.

this.table = document.getElementById(tableId);
currentTb = document.createElement("TBODY");
currentRow = document.createElement("TR");
currentCell = document.createElement("TD");
currentElement = document.createTextNode("text");
currentCell.appendChild(currentElement);
currentElement = document.createElement("input");
currentElement.setAttribute("type", "text");
currentElement.setAttribute("name", "textBoxName");
currentElement.setAttribute("id", "textBoxId");
currentElement.setAttribute("size", "8");
currentCell.appendChild(currentElement);
currentElement = document.createElement("input");
currentElement.setAttribute("type", "checkbox");
currentElement.setAttribute("name", "checkBoxName");
currentElement.setAttribute("id", "checkBoxId");
currentElement.setAttribute("value", "t");
currentCell.appendChild(currentElement);
currentRow.appendChild(currentCell);
currentTb.appendChild(currentRow);
this.table.appendChild(currentTb);

Sorry for long mail

Thanks in advance
Raghuram Banda

Jul 20 '05 #1
1 3574
And on the day Fri, 07 Nov 2003 05:31:10 GMT,
ra************@nokia.sify.net enlightened us with <y6Gqb.2047$g4.45509
@news2.nokia.com>...
Hi all,

I've created a table with Table Header and the table may or may not
contain any rows initially.
I've included a .css file in <head> section of my HTML script and I'm
creating rows to the table
dynamically using JavaScript (using DOM), and the problem is those
created bby DOM are not
following style sheet rules applicable for table rows and cells. But the
rows created from within
HTML script are following style sheet rules. The following is sample
which is used to create
dynamic row.


currentTb = document.createElement("TBODY");

If the table is already created, this might be mucking things up. I'm
not sure, but try creating the tbody with the table header instead of
via script. This might somehow be creating a second tbody.

Just a thought.
--
--------------------------------------------------
~kaeli~
Winerr 01C - Wrong Disk Formatted. Sorry About That.
Winerr 01D - Enter any 11-digit prime number to continue.
http://www.ipwebdesign.net/wildAtHeart/
http://www.ipwebdesign.net/kaelisSpace/
------------------------------------------------
Jul 20 '05 #2

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

Similar topics

3
by: rufus | last post by:
I am created a table dynamically and I have wrapped it in a div tag so that the user can scroll the table horizontally ie I have added an overflow property to the div. I dont want the user to be...
4
by: Jorey Bump | last post by:
I can retrieve today's date: mysql> SELECT CURDATE() AS begin; +------------+ | begin | +------------+ | 2005-06-01 | +------------+ 1 row in set (0.00 sec)
0
by: sameer mowade via .NET 247 | last post by:
Hello All, I have problem while dynamically removing row from the Datagrid which i have added dynamically as shown in the following code snippet. The problem is that while removing dynamically...
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...
4
by: assgar | last post by:
Hi I am stuck on a problem. I use 3 scripts(form, function and process). Development on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. The form displays...
2
by: jmarendo | last post by:
Hello, After reading through the "Table Basics - DOM - Refer to table cells" example at mredkj.com , I modified the code for my own purposes. In the modified version, I create a hyperlink and...
4
by: mohaaron | last post by:
I can think of a lot of reasons why this might need to be done but as far as I can tell it's not possible. I've been looking for a way to add HtmlTableRows to a table using a button click for a...
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.