473,651 Members | 3,049 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic Table

Hi Guyz,

I am trying to make a dynamic table which will automatically update
after running a query.
My Table contains 4 columns.

I am trying to update the table by adding rows of information to it.
But i am able to add only one column, how can i insert 4 columns and
make the table resize automatically.

My Function.
function getRoomDetails( )
{

var table = document.getEle mentById('roomT able');
var row = document.create Element("tr");
var cell = document.create Element("td");
var cell2 = document.create Element("td");
var cell3 = document.create Element("td");
var cell4 = document.create Element("td");
var cellText = document.create TextNode("Colum n 1");
var cellText1 = document.create TextNode("Colum n 2");
var cellText2 = document.create TextNode("Colum n 3");
var cellText3 = document.create TextNode("Colum n 4");
cell.appendChil d(cellText);
cell1.appendChi ld(cellText1);
cell2.appendChi ld(cellText2);
cell3.appendChi ld(cellText4);
row.appendChild (cell);
row.appendChild (cell2);
row.appendChild (cell3);
row.appendChild (cell5);
table.appendChi ld(row);

}

any help would be appreciated.

Thanks,
Hj

Jan 25 '07 #1
2 4784


On Jan 25, 3:01 pm, "jainharsh" <jain.perso...@ gmail.comwrote:
Hi Guyz,

I am trying to make a dynamic table which will automatically update
after running a query.
My Table contains 4 columns.

I am trying to update the table by adding rows of information to it.
But i am able to add only one column, how can i insert 4 columns and
make the table resize automatically.

My Function.
function getRoomDetails( )
{

var table = document.getEle mentById('roomT able');
var row = document.create Element("tr");
var cell = document.create Element("td");
var cell2 = document.create Element("td");
var cell3 = document.create Element("td");
var cell4 = document.create Element("td");
var cellText = document.create TextNode("Colum n 1");
var cellText1 = document.create TextNode("Colum n 2");
var cellText2 = document.create TextNode("Colum n 3");
var cellText3 = document.create TextNode("Colum n 4");
cell.appendChil d(cellText);
cell1.appendChi ld(cellText1);
cell2.appendChi ld(cellText2);
cell3.appendChi ld(cellText4);
row.appendChild (cell);
row.appendChild (cell2);
row.appendChild (cell3);
row.appendChild (cell5);
table.appendChi ld(row);

}any help would be appreciated.

Thanks,
Hj
Make sure you're appending the tr to either a thead or a tbody.

- Craig Taylor
http://www.ctalkobt.net

Jan 25 '07 #2
jainharsh wrote :
Hi Guyz,

I am trying to make a dynamic table which will automatically update
after running a query.
My Table contains 4 columns.

I am trying to update the table by adding rows of information to it.
But i am able to add only one column, how can i insert 4 columns and
make the table resize automatically.
Then do not set the table width otherwise you will be over-constraining
the table.
And as mentioned by Craig, append the table rows to a table section
(thead or tbody) because IE 6+ has a known bug on this.

Dynamically creating, populating and inserting a table
http://www.gtalbot.org/DHTMLSection/CreatingTable.html

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Jan 25 '07 #3

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

Similar topics

4
13059
by: Tim.D | last post by:
People, I've ventured into the wonderful world of Stored Procedures. My first experience has been relatively successful however I am stuck on using host variables to specifiy actualy table or column names in a FROM clause. After many hours or reading all manner of manuals I've discovered it appears this is not possible and that in order to so I need to further venture into dynamic SQL. My present procedure is based on all static SQL...
14
14810
by: Ina Schmitz | last post by:
Hello, I would like to get the logical and physical reads for every sql statement executed. Thatfore, I used the command "db2 get snapshot for dynamic sql on <mydatabase>". There, I could see the logical and physical reads from bufferpool for every statement monitored. Am I right? But now, I would like to read these results out of a table so that I could process them automatically. In which table(s) are the results of snapshot for...
1
17657
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to Create a Dynamic Crosstab Report PRODUCT :Microsoft Access PROD/VER:1.00 1.10 OPER/SYS:WINDOWS
3
2937
by: CAD Fiend | last post by:
Hello, Well, after an initial review of my database by my client, they have completely changed their minds about how they want their form. As a result, I'm having to re-think the whole process. My Current Form (6 tabs): - Owner, Property, Title, Docs, Queries, & Reports - User is able to see (while navigating through the tabs) above in the form : Owner Name, Address, Parcel, and SSN
1
3336
by: Henke | last post by:
Hello, I have one ImageButton controls which I initialize in Page_Load and declare on class level. ImageButton save = new ImageButton(); save.ImageUrl = "save.gif" save.Click += new ImageClickEventHandler(this.save_click); This ImageButton is added to a dynamic table which is also
7
1884
by: Abraham Luna | last post by:
how do i stop the dynamic validators from breaking explorer if i use a dynamic validator and move to a different control it breaks explorer and i can type in the page when i'm not supposed to. thank you.
7
3383
by: serge | last post by:
How can I run a single SP by asking multiple sales question either by using the logical operator AND for all the questions; or using the logical operator OR for all the questions. So it's always either AND or OR but never mixed together. We can use Northwind database for my question, it is very similar to the structure of the problem on the database I am working on. IF(SELECT OBJECT_ID('REPORT')) IS NOT NULL DROP TABLE REPORT_SELECTION
0
5278
by: Eniac | last post by:
Hi, I've been working on a custom user control that needs to be modified and the validation is causing me headaches. The control used to generate a table of 4 rows x 7 columns to display all the days in the week with dates and textboxes to fill in some data. row 1: question
6
7964
by: =?ISO-8859-1?Q?Tim_B=FCthe?= | last post by:
Hi, we are building a Java webapplication using JSF, running on websphere, querying a DB2 9 on Suse Enterprise 10. The app uses JDBC and PreparedStatements only (aka dynamic SQL). Every night, there is a ETL which deletes most of the data in the database and fills it all new. We observed very bad performance for some statements that ran for minutes (The queried table is about 100,000 records and the result is about 500 rows)....
12
24798
by: ive1122 | last post by:
Hi guys, I am looking into create a dynamic survey as posted in Get User Input From Dynamic Controls but with some different environment Below is what i am trying to do: First when the user click the button, it will populate a dynamic table with radio button for the survey questionnaire However, i was unable to get its value (for score calculation) after clicking the submit button Beside i am using an ajax extension (updatePanel) for the...
0
8361
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8278
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8807
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8701
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8466
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4290
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.