473,396 Members | 2,061 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.

Problem with the alignment of new element insertion!

Hi,

I have a template that has several tables, I need to dynamically add
new elements to one of them, however, I'm having a hard time to append
a new element and some space like <br> after that.

Part of the HTML code look like
<table ID="parent">
<tr>
<td>
<table ID="left">
<tr>
<td>Left navigation one</td>
</tr>
...
</table>
</td>

<td>
<table ID="right">
<tr>
<td>Content here</td>
</tr>
...
add new element here
</table>
</td>
</tr>
</table>

FYI, I don't have a problem adding a new element using
document.createElement function, however, as stated, the new element
was appended to the bottom, instead of, it appears to the right of the
last table.

f = document.getElementById('theForm');
more code for new element addition here ...

// add some space
var b = document.createElement('<br>');
f.appendChild(b);

// try the following does not help either
f.appendChild(document.createElement("<tr><td colspan='2'
height='5'></td></tr>"));

it looks like I need to reference the table object instead of FORM
obj for the above, however, I failed to assign a var to the table
object either by ID or name, would greatly appreciate your help.

TIA.
Jul 23 '05 #1
1 1341
DaaaDaaa wrote:
I have a template that has several tables, I need to dynamically add
new elements to one of them, however, I'm having a hard time to append
a new element and some space like <br> after that.

Part of the HTML code look like
<table ID="parent">
<tr>
<td>
<table ID="left">
<tr>
<td>Left navigation one</td>
</tr>
...
</table>
</td>

<td>
<table ID="right">
<tr>
<td>Content here</td>
</tr>
...
add new element here
</table>
</td>
</tr>
</table>

FYI, I don't have a problem adding a new element using
document.createElement function, however, as stated, the new element
was appended to the bottom, instead of, it appears to the right of the
last table.

f = document.getElementById('theForm');
more code for new element addition here ...


There is no element with ID `theForm' in the code you have posted, so I
suggest you post the parts of your code that include the element with
that ID and all its child elements and text nodes, or post the URL of
a test case.
PointedEars
Jul 23 '05 #2

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

Similar topics

4
by: Helene Pinol | last post by:
Dear All I have a problem to insert elements in a combination of containers. Here is the declaration of the container I would like to use: vector< set<myElement> >...
6
by: Daniel Lidström | last post by:
Hi, how do I synchronize (to XML using XmlSerializer) something to this: <Alignments name="Road Project"> <Alignment name="Centerline"> <CoordGeom> <Line staStart="0"> <Start>2000...
5
by: John N. | last post by:
Hi All, Here I have a linked list each containing a char and is double linked. Then I have a pointer to an item in that list which is the current insertion point. In this funtion, the user...
67
by: S.Tobias | last post by:
I would like to check if I understand the following excerpt correctly: 6.2.5#26 (Types): All pointers to structure types shall have the same representation and alignment requirements as each...
5
by: Erwan Loisant | last post by:
Hello. I can't properly add elements to a GArray. Basically I have a GArray of GList, so here is what I do to append an element in a given GList of my GArray: 1. GList* currentBucket =...
17
by: puzzlecracker | last post by:
> 2) >>struct B >>{ >> int i; >>short int si; >> char c; >> char d; >> int j; >>};
39
by: Martin Jørgensen | last post by:
Hi, I'm relatively new with C-programming and even though I've read about pointers and arrays many times, it's a topic that is a little confusing to me - at least at this moment: ---- 1)...
4
by: Gaijinco | last post by:
I'm doing a template class to make an ordered list. I created a class Person to make an agenda. When I create a new person, there's no problem but when I try to add it to the list it throws a...
7
by: raknin | last post by:
Hi I have a carousel script. I want to load the carousel with a new set of pictures every time I press a button. The problem that I have that the script append the new pictures to the olds one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.