473,402 Members | 2,053 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,402 software developers and data experts.

Anybody know how to add a table using DOM/JS/execCommand with an iFrame

AAAAARRRRGGGGHHHH!!!

Everything appears to be great in doing a web-based editor using the
execCommands apart from the fact that there is no method to insert a table.

I've seen somebody suggest that you create the table using pure DOM, but I
can't reference it to the relevant place in the iFrame that I'm using, ie if
I want to insert a table between 2 pieces of text that have just been typed
then how to get the table to go into there.

The annoying thing is you have great control of the table when it is in the
iFrame, but it's getting it in there that's the problem.

Has anybody got any ideas on how I can do this?

Thanks

Laphan
Jun 17 '06 #1
2 5692


Laphan wrote:

Everything appears to be great in doing a web-based editor using the
execCommands apart from the fact that there is no method to insert a table.


With IE pasteHTML should do e.g.
document.selection.createRange().pasteHTML([
'<table border="1">',
'<tbody>',
'<tr>',
'<td>Kibology for all.</td>',
'</tr>',
'</tbody>',
'</table>'
].join('\r\n'))

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jun 17 '06 #2
Many thanks Martin

Hope you are well.

Rgds Laphan
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:44***********************@newsread4.arcor-online.net...
Laphan wrote:

Everything appears to be great in doing a web-based editor using the
execCommands apart from the fact that there is no method to insert a
table.


With IE pasteHTML should do e.g.
document.selection.createRange().pasteHTML([
'<table border="1">',
'<tbody>',
'<tr>',
'<td>Kibology for all.</td>',
'</tr>',
'</tbody>',
'</table>'
].join('\r\n'))

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jun 17 '06 #3

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

Similar topics

1
by: Edd Read | last post by:
Hi, I have made a basic WYSIWYG editor using the execCommand functions. I use an iFrame as the editing area and so far I have managed to create documents from a blank page and save them to a...
3
by: Sharon | last post by:
Hi! I need help. I have a variable which is just a string containing the output of a transform from XML to CSV format. I want the client to be able to download this as a file (.csv), so I used...
1
by: anonieko | last post by:
> Use x = window.Open(...) x.document.write( yourhtml) > How to print from javascript using .print > How to use ContentWindow > > How t use getElementById > How to get HTML of document...
4
by: am75 | last post by:
Hi everybody, I'm developing web pages for content management using iframes, through which users can edit html portions... I found execCommand to apply simple formats (bold, italic...) to text....
0
by: Laphan | last post by:
AAAAARRRRGGGGHHHH!!! Everything appears to be great in doing a web-based editor using the execCommands apart from the fact that there is no method to insert a table. I've seen somebody suggest...
23
by: abdalimohd | last post by:
hi all, i m developing an html editor for my web page since i cannot trace out the enter key press for the available html editors for asp.net app. now i have done everything that i need with this...
1
by: appleseed | last post by:
I'm having some problems on IE with a small editor I'm building. The source of the problem is the following: Consider having an iFrame with designMode="on" in which you select some text. When...
9
by: shailaja.sheel | last post by:
Hi , This is my first attempt to do some html/javascript programming and I am totally lost. I have a questionaire form and when user clicks Submit, I want to save the data in XML file on client...
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
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: 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
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,...
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.