Source language: Translate to:

Array2Table - display arrays as HTML - import Excel data

Share sample pubs, scripts, etc. with other NeoBook users

Moderator: Neosoft Support

Array2Table - display arrays as HTML - import Excel data

Postby dpayer » Tue Apr 03, 2012 1:23 pm

I have created this project with the hope of developing a clean function to display 2 dimensional variable arrays as HTML tables and to import data from Excel / MSWord / Internet Explorer into arrays for use as data in NB apps.

The demo is not a polished one but shows core functionality. I would appreciate feedback and suggestions on creating additional properties that could be developed for this.


Display the contents of a NB variable array as an HTML table. The samples here have data in a comma separated set for each element of the array
Code: Select all
myArray1 = val1","val2","val3","val4"
myArray2 = val5","val6","val7","val8"

etc. . . . .


I have created a simple data entry form - sample real estate data - to place data in an array which is then displayed as an HTML table.

The appearance / colors of the table are controlled by CSS (see below). Remember: HTML tables can contain pictures and links if your data defines the cell as such. I have also provided a way to control which columns are displayed.



Copy/paste the contents of a Excel spreadsheet / MS Word table / or Internet Explorer table into a variable array for use as data in your application. 100 columns x 20 rows of text data from a spreadsheet was imported and then displayed as html in 6 seconds by creating a 100 element array with 20 data items per element.


Transferring data from Excel and Word tables is consistent. Copying from tables displayed in IE is less so as you can create tables using CSS vs HTML and you can use non-standard HTML and still have it look like a normal table. Still, you may find the results helpful.

I use the HTML editor TinyMCE to assist in the IE table information transfer. You will need some additional files (below) for that part to work.

If you would just like to see the functionality of this, you can download the compiled executable HERE

Here is the NB pub file. It will require a NB function I made in order to use the column selection property. The function - click here - is named movebetweenlistboxes

For the pasting from Internet Explorer tables you will need to have two folders in your [pubdir] folder: html & jscripts. The zip files are here: &

If you don't have a html table right at hand, here is one

You will need those even for the compiled app as I didn't include them as embedded files.

I will work to create a means to add header rows and as mentioned, I hope to release this as a NB function.

I have other projects in mind that use the BrowserObject including runtime objects (listboxes / combo boxes / text boxes, etc.) and I am currently working on a HTML editor that I want to release as shareware.

Let me know what you think would enhance the functionality of this project.

David P.
User avatar
Posts: 1386
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby Luiz Alfredo » Tue Apr 03, 2012 5:59 pm

Good work. Thanks.
Luiz Alfredo
Posts: 196
Joined: Thu Apr 19, 2007 6:58 am
Location: Brazil

Postby Neosoft Support » Wed Apr 04, 2012 10:28 am

Very cool. Thank you for sharing this with us.
NeoSoft Support
Neosoft Support
NeoSoft Team
Posts: 5620
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Wrangler » Wed Apr 04, 2012 10:35 am

Looks interesting. Nice work, David.
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
User avatar
Posts: 1513
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Return to Sample NeoBook Pubs

Who is online

Users browsing this forum: No registered users and 2 guests