Investment Banking Word Table Formatter
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md and install @user_44747f29/touhangwordbiaogemeihua into your AI assistant.
About this skill
Problem: table formatting drifts across deal documents
Investment banking workbooks often arrive as .docx files where tables have inconsistent padding, indentation, fonts, header hierarchy, and total rows. Manual cell-by-cell cleanup is slow and easy to miss after copy-paste or multi-author edits.
Core capabilities
- Scans all tables in the document and changes formatting only, leaving content unchanged.
- Normalizes cell before/after paragraph spacing to 0 lines and single line spacing, clearing first-line, left, and right indents.
- Applies outer borders at 1.5 pt and inner borders at 0.5 pt, with vertical center alignment.
- Detects single-row or multi-row headers and applies center alignment + bold.
- Aligns columns by role: first column, serial-number, and year-like columns are centered; numeric/finance columns are right-aligned; other columns are left-aligned.
- Detects trailing total/subtotal rows and applies bold, while reducing false positives from remarks containing total-related words.
- Applies font rules: Chinese text uses SimSun, English/numeric text uses
Times New Roman, with uniform10.5ptsize.
How it works
The script scripts/format_tables.py uses python-docx and lxml to inspect OOXML structure. Header detection uses signals such as w:vMerge, w:gridSpan, finance keywords, and adjacent-row inference. Numeric-column detection skips headers and treats a column as numeric when more than 50% of non-empty cells are numbers, currency, or percentage formats. Merged horizontal cells are mapped from logical columns to physical cells to reduce alignment errors.
Boundaries and notes
This is best for batch-normalizing existing .docx tables; it does not restructure complex merged layouts, redraw charts, or change business logic. By default the output is saved as _美化.docx, and overwrite happens only if the same output path is explicitly provided. Cross-platform use may fall back from SimSun on non-Windows systems. When editing OOXML, avoid naive append() calls and preserve child-element order.
Use Cases
- Normalize borders, fonts, and 10.5pt sizing across many finance tables in a .docx memo.
- Detect multi-row and merged-cell headers, then center, bold, and right-align numeric columns.
- Batch-clean paragraph spacing and indentation from Word tables exported from valuation models.
- Bold total rows in appendix income, cost, and ratio tables without triggering on remarks.
Best For
- Investment banking analysts: standardize Word table formatting before delivering financing materials.
- Securities researchers: normalize headers and numeric alignment across multiple finance tables.
- Due diligence project managers: batch-clean indentation and borders in assembled .docx workpapers.
- Documentation operations staff: unify borders, fonts, and header formatting in client-provided .docx tables.
Related Skills
Generate and edit .pptx decks with python-pptx, applying structured layouts, design rules, native charts, and visual QA to reduce template-like output.
Tencent Cloud Table Recognition V3 is an OCR skill for detecting and recognizing tables in images or PDFs, supporting various table types like linear and borderless tables, with Excel export.
The complete set of online document operation tools provided by Tencent Docs MCP, supporting creation, querying, and editing of smart docs, Excel, PPT, mind maps, and more.
Turn a topic, notes, or tables into a complete PPT plan with logic, page layouts, visual and chart guidance, and natural defense scripts.