简体   繁体   中英

Itext 7 alternative for itext 5 table.deleteBodyRows()

I had to work on the project that used Itext 5, I am working on migrating it to Itext 7.

In Itext 5 they use table.deleteBodyRows() to clean the entire table body after writing it to the document and again manipulate the same table.

But Itext 7 there is no deleteBodyRows() method associated with Table. is there any alternative method for delete entire table body or otherwise what is the best way to handle this kind of scenarios.

Even after some research, I was unable to find the proper iText specific answer for this question.

So, as @mkl mentioned we can re-initiate/ create a new table each time we write the data to the document. Just create a separate method to create a table with necessary structures and styles will reduce the workload you have to do when you create tables again and again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM