insert programmatically a table in a notebook

Hi all,

I'm writing a procedure to generate reports and I'm wondering if it's possible (Is there a simple way) to insert programmatically a table in a notebook like in the attached picture.
By the way, I've done that with a copy-paste from a layout.

Thanks
Make/O/N=5 jack=p
Edit/N=TestTable jack
NewNotebook/F=1/N=TestNotebook
Notebook TestNotebook, picture={TestTable, 0, 1}

Thank you hrodstein, this is what I'm looking for.
But, is it possible to insert only columns with data like the first column ("jack") and not the rest of the empty table ?
Quote:
But, is it possible to insert only columns with data like the first column ("jack") and not the rest of the empty table ?

You would have to resize the table window, either manually or programmatically using the MoveWindow operation, to show what you want to show.

Alternatively you can display the values of the wave as plain text:
//  Example:
//  NewNotebook/F=1/N=TestNotebook
//  Make/O jack={1,2,PI,4}
//  Insert1DWaveInNotebook("TestNotebook", jack)
Function Insert1DWaveInNotebook(nb, w)
    String nb               // Name of notebook
    Wave w
   
    Variable numPoints = numpnts(w)
    if (numPoints > 100)
        Abort "Too many points in wave"
    endif
   
    Variable i
    for(i=0; i<numPoints; i+=1)
        String valueText
        sprintf valueText, "%g\r", w[i]
        Notebook $nb, text=valueText
    endfor 
End

hrodstein, I think I didn't express myself very clearly....

what I'm looking for is explained in the attached image...

NoteookTable2.png (18.96 KB)
You would have to resize the table window, either manually or programmatically using the MoveWindow operation, to show what you want to show. You need to do this before inserting the table in the notebook. What is inserted is a picture of the table window at the time you execute the Notebook command.

Thank you hrodstein .
It works with "MoveWindow" but I have to adapt the size for each table because my tables do not necessarily have the same number of lines.
But it's a good start, I keep looking ...