Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table With no rows #245

Open
BorisVolkan opened this issue Sep 17, 2024 · 1 comment
Open

Table With no rows #245

BorisVolkan opened this issue Sep 17, 2024 · 1 comment
Labels
question Further information is requested

Comments

@BorisVolkan
Copy link

There is a problem with this code:

var activitiesTable = document.AddTable(1, numberOfColumns, WordTableStyle.TableGrid);
activitiesTable.Rows[0].Remove();
var headerRow = activitiesTable.AddRow();

The exception that I get i:
Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')

Can you make the WordTable constructor accept 0 as rowCount, or handle AddRow method for this scenario.

Thank you

@PrzemyslawKlys
Copy link
Member

The problem is that Table without rows and cells and at least paragraph in a cell creates broken document. So while technically it would be possible to do that, it would probably create other issues. Why can't you simply add header row content/table content normally?

@PrzemyslawKlys PrzemyslawKlys added the question Further information is requested label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants