Welcome to Dream.In.Code
Become an Expert!

Join 149,534 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,527 people online right now. Registration is fast and FREE... Join Now!




Please help me !

 
Reply to this topicStart new topic

Please help me !, How can i create a table and add rows

roma2008
10 Jun, 2007 - 09:20 PM
Post #1

New D.I.C Head
*

Joined: 18 Nov, 2006
Posts: 4


My Contributions
hi everybody,
i'm new in javascript. i want to create table and add rows to the table .
like i have 3 text box , and table .
the 3 text box is (id , name , descraption ) and a button .i want insert the information into the textbox and it will go automaticlly to the table
I'm using dojo and javascript .. and the editor is my Eclipse
Thanks


This post has been edited by roma2008: 11 Jun, 2007 - 12:04 AM
User is offlineProfile CardPM
+Quote Post

Israel
RE: Please Help Me !
10 Jun, 2007 - 09:54 PM
Post #2

D.I.C Addict
Group Icon

Joined: 21 Nov, 2004
Posts: 626


Dream Kudos: 175
My Contributions
Well, I would first suggest you stop using annoying fonts and stick with the defaults. Second I would suggest you accually try to write the code yourself first. Even if it doesn't work, do it! If you can't finish it, or can't get it to run right then post it here. No one is just going to write this for you. That's not what these forums are for.

This post has been edited by Israel: 10 Jun, 2007 - 09:55 PM
User is offlineProfile CardPM
+Quote Post

Arbitrator
RE: Please Help Me !
11 Jun, 2007 - 08:56 AM
Post #3

D.I.C Regular
Group Icon

Joined: 26 Jan, 2005
Posts: 492



Thanked: 1 times
My Contributions
Basic JavaScript Example:

CODE
var table = document.createElement("table"); // Create a table element.
var rowGroup = document.createElement("tbody"); Create a table row group element.
var row = document.createElement("tr"); // Create a table row element.
var dataCell = document.getElement("td"); // Create a table data cell element.
var text = document.createTextNode("Example Text"); // Create a text node.
dataCell.appendChild(text); // Put the text into the table data cell element.
row.appendChild(dataCell); // Put the table data cell element into the row element.
rowGroup.appendChild(row); // Put the table row element into the table row group element.
table.appendChild(rowGroup); // Put the table row group element into the table element.
document.getElementsByTagName("body")[0].appendChild(table); // Put the table element into the document body element.
// You now have a one‐cell table element as the last item of the document body element.

This example shows you how you would create a table element (or any other element) in JavaScript via the DOM. It you want help more specific to your issue, then I would suggest that you follow previous advice and show us the code for your personal attempt to solve your issue.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 09:04PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month