TAdvWebBrowser - Display a HTML-Table in a TAdvStringGrid

I have a Website with some Tables and I want to display the table with the name "analytic-items" in a TAdvStringGrid. The table has a indefinite number of lines. I want to used TAdvWebBrowser.ExecuteJavascript but I don’t have a successful result. Can you please help me? In the attachment is the sinplified source code:
analytic-items.html (835 Bytes)

I'm not sure I understand what you try to accomplish.
You want to open this HTML file with TAdvStringGrid?
If so, importing HTML in TAdvStringGrid is not supported. HTML files can contain anything, not just tables, so a HTML file having just a single table is a very specific HTML file type. For this exceptional HTML file, we do not have a built-in method to import it into TAdvStringGrid. There are several other formats supported, the easiest of which is CSV.

I loaded a website with several tables in TAdvWebBrowser. I'm only interested in the data in the "analytic-items" table. I have reduced the source code of this table to the essentials and attached it. I don't want to load the HTML code into TAdvStringGrid, I just want to transfer the data from this table to a TAdvStringGrid for further analysis. I think this should work with TAdvWebBrowser.ExecuteJavaScript. I tried a lot and looked on the web, unfortunately without success.

You'd need to write the necessary JavaScript code to loop through this table, fetch the values and return these to the native application holding the TAdvWebBrower and load it upon return in TAdvStringGrid.

Dear Bruno Fierens! The theory is clear to me, but as a Pascale programmer I have too little Java experience. The documentation on the web is not enough for me either. Can you please help me with a tutorial or sample code?

Please understand that it is beyond the scope of our support services for TAdvWebBrowser to write any kind of specific JavaScript functions.

I found this JavaScript code snippet via Google that retrieves cell data from a table as CSV string data:

   function getTableData() {
        var s = "";
        var myTab = document.getElementById('myTable');

        // LOOP THROUGH EACH ROW OF THE TABLE AFTER HEADER.
        for (i = 1; i < myTab.rows.length; i++) {

            // GET THE CELLS COLLECTION OF THE CURRENT ROW.
            var objCells = myTab.rows.item(i).cells;

            // LOOP THROUGH EACH CELL OF THE CURENT ROW TO READ CELL VALUES.
            for (var j = 0; j < objCells.length; j++) {
                s = s + '"'' + objCells.item(j).innerHTML+'";';
            }
            s = s + "\r\n";     // ADD A BREAK (TAG).
        }
	return s;
    }

Thank you :+1: