Delete Column from a XSLFTable

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

Delete Column from a XSLFTable
I need to delete a column from a table in a PPT slide. I don't see an method on XSLFTable that will allow me to do this.  I've experimented extensively with this, but it doesn't work properly:

                         CTTableGrid tableGrid = table.getCTTable().getTblGrid();
    CTTableCol[] columns = tableGrid.getGridColArray();
    columns = ArrayUtils.remove(columns, columnIndexToDelete);

It always seems to delete the last column of the table, regardless of the index passed in.
I've also tried this:


It results in the same behavior. Any suggestions?

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view

Re: Delete Column from a XSLFTable

I've prepared an example on how to delete a column - does it work for you?:

... and yes, I guess this should be inside the API and a few package access methods made public.
I think I haven't yet made the setGridSpan & Co. methods public, as I wanted to have an implementation for HSLF too.


signature.asc (495 bytes) Download Attachment