agentic-net-examples / working-with-tables
AGENTS.md1 starsChanged 2 months agoMITView on GitHub
Create focused C# examples for structured Excel tables (ListObject). Follow ../AGENTS.md, then this guide. Existing generated examples require independent API and runtime validation. In scope: create/name/find/enumerate/resize/delete tables, columns, styles, header/totals/bands, filters, calculated columns, totals, membership, and conversion to a range. Out of scope: generic cells or ranges, formula calculation itself, slicers and pivot tables, and external query authentication or execution. Use explicit types, deterministic headers/data, one table capability, a valid unique display name, and metadata describing input/output and expected state.…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository32 other files it gives its agents.
- Aspose.Cells for .NET Product AgentAGENTS.md
- calculate-formulas/AGENTS.mdAGENTS.md
- cells-data/AGENTS.mdAGENTS.md
- comments-and-notes/AGENTS.mdAGENTS.md
- conversion/AGENTS.mdAGENTS.md
- document-properties/AGENTS.mdAGENTS.md
- encryption-and-protection/AGENTS.mdAGENTS.md
- format-cells/AGENTS.mdAGENTS.md
- globalization-and-localization/AGENTS.mdAGENTS.md
- macro-project/AGENTS.mdAGENTS.md
- manage-formulas/AGENTS.mdAGENTS.md
- manage-workbook/AGENTS.mdAGENTS.md
- managing-ranges/AGENTS.mdAGENTS.md
- open-workbook/AGENTS.mdAGENTS.md
- pivot-table/AGENTS.mdAGENTS.md
- queries-and-connections/AGENTS.mdAGENTS.md
- rows-and-columns/AGENTS.mdAGENTS.md
- save-workbook/AGENTS.mdAGENTS.md
- slicer/AGENTS.mdAGENTS.md
- smart-markers/AGENTS.mdAGENTS.md
- sparkline/AGENTS.mdAGENTS.md
- timeline/AGENTS.mdAGENTS.md
- workbook-merger/AGENTS.mdAGENTS.md
- working-with-charts/AGENTS.mdAGENTS.md
- working-with-html/AGENTS.mdAGENTS.md
- working-with-images/AGENTS.mdAGENTS.md
- working-with-json/AGENTS.mdAGENTS.md
- working-with-pdf/AGENTS.mdAGENTS.md
- working-with-shapes/AGENTS.mdAGENTS.md
- working-with-worksheets/AGENTS.mdAGENTS.md
- xml-maps/AGENTS.mdAGENTS.md
- llms.txtllms.txt
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Create focused C# examples for structured Excel tables (ListObject).
- Distinctive: line 82
Use explicit types, deterministic headers/data, one table capability, a valid unique display name, and metadata describing input/output and …
- Very specific: line 88
Use ListObjects.Add to create a table, TableStyleType for a built-in style, ShowTotals and column total settings for totals, AutoFilter for …
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Aspose.Cells Tables Agent Instructions
Mission and boundary
Create focused C# examples for structured Excel tables (ListObject). Follow ../AGENTS.md, then this guide. Existing generated examples require independent API and runtime validation.
In scope: create/name/find/enumerate/resize/delete tables, columns, styles, header/totals/bands, filters, calculated columns, totals, membership, and conversion to a range.
Out of scope: generic cells or ranges, formula calculation itself, slicers and pivot tables, and external query authentication or execution.
Canonical answer
using System;
using Aspose.Cells;
using Aspose.Cells.Tables;
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Cells["A1"].PutValue("Product");
worksheet.Cells["B1"].PutValue("Quantity");
worksheet.Cells["A2"].PutValue("Notebook");
worksheet.Cells["B2"].PutValue(12);
worksheet.Cells["A3"].PutValue("Pen");
worksheet.Cells["B3"].PutValue(30);
int index = worksheet.ListObjects.Add("A1", "B3", true);
ListObject table = worksheet.ListObjects[index];
table.DisplayName = "InventoryTable";
table.TableStyleType = TableStyleType.TableStyleMedium2;
if (worksheet.ListObjects.Count != 1 ||
table.DisplayName != "InventoryTable")
{
throw new InvalidOperationException("The table was not created.");
}
workbook.Save("excel-table.xlsx");
Console.WriteLine("Created InventoryTable with two data rows.");API truths and map
| Goal | API |
| Access tables | Worksheet.ListObjects |
| Create a table | ListObjectCollection.Add |
| Configure table | ListObject |
| Configure columns | ListColumns, ListColumn |
| Apply built-in style | TableStyleType |
| Filter table | ListObject.AutoFilter |
| Convert to range | ConvertToRange, TableToRangeOptions |
- Excel tables are
ListObjectinstances; a styled range is not a table. Addreturns an index. Range endpoints are inclusive; numeric indexes are zero-based.- The header flag means the first range row already contains headers.
- Headers must be nonempty, unique, and suitable for a table.
DisplayNamemust be valid, workbook-unique, contain no spaces, and not resemble a cell reference.ConvertToRangeremoves table semantics even if formatting remains.- Filtering hides rows; it does not delete them.
- Calculate formulas explicitly before validating calculated columns or totals.
Contract, validation, and safety
Use explicit types, deterministic headers/data, one table capability, a valid unique display name, and metadata describing input/output and expected state. Verify table count, range, columns, style, totals, filters, or absence after conversion; reopen the workbook when persistence matters.
Sanitize imported headers and table names, prevent formula injection, avoid credentials and external query execution, cap range sizes, cache table references, apply bulk changes, and save once. Do not confuse formatting with table semantics or filtering with deletion.
AI retrieval and FAQ
Use ListObjects.Add to create a table, TableStyleType for a built-in style, ShowTotals and column total settings for totals, AutoFilter for filters, and ConvertToRange to remove structured-table behavior.
Official resources
Definition of done
The example compiles, runs, creates or changes a real ListObject, verifies semantic table state and persisted output, and contains no unrelated query or UI dependency.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

