Output Formats
Gridwell renders the table IR to 11 output formats, split into text (returns a string) and binary (returns bytes). Which styling features each stable writer (HTML, LaTeX, Typst, RTF, DOCX, XLSX) actually expresses is measured, not claimed: see the Feature Matrix. Where a format can’t express a feature a table uses (the notes below say which), you can ask for a warning saying where before rendering, and gridwell convert prints one.
Experimental formats
SVG, ANSI, Pandoc and Quarto are experimental. Their output is valid, with every cell where the table puts it: like the stable formats’ output, it is read back as a grid, spans and hidden columns included, and compared with the table’s. But their styling is best-effort, and how a table looks in them may change between releases. The other seven formats are stable. Which formats are experimental is in the format list: gridwell formats marks them, and the experimental field of gridwell formats --json, gridwell.formats() (Python) and gw_formats() (R) is true for them.
Two styles are CSS values that other formats translate:
font_familyis a CSS font list, which HTML writes as given. Typst takes the whole list as font names; RTF, DOCX, XLSX and PPTX take one font per run, the first name in the list. Either way, a generic family becomes a common font (serifTimes New Roman,sans-serifArial,monospaceCourier New), while generics with no common font (system-ui,cursive, …) and vendor keywords such as-apple-systemare dropped. A list naming no font leaves the format’s default font. LaTeX writes only monospace families (below); SVG draws in its own font, and ANSI, Pandoc and Quarto have no fonts.text_transform(uppercase,lowercase,capitalize) changes the text itself in every format except HTML, where CSS’stext-transformapplies it and the markup keeps the text as written. Footnote marks are never transformed.
A style’s font_weight replaces the weight a format draws by default: normal (or lighter) un-bolds column labels, the title or a group label, and a styled run’s weight replaces its cell’s, so a normal run in a bold cell is not bold. Pandoc and Quarto have bold (Strong) but no way to undo it, and ANSI draws its title and group labels bold whatever their style. font_style works the same way: a normal run in an italic cell, title or note is upright, except in Pandoc and Quarto (Emph can’t be undone). Underline and strike-through are different: as in CSS, a run adds them to its cell’s but can’t remove them.
Links
A text run with an href is a link to it. Only http, https and mailto URLs are links: a run with any other href (in IR that wasn’t validated) is drawn as plain text. Each format writes the URL in ASCII, with its scheme lowercased and what a URL can’t hold as it is percent-encoded (https://例え.jp is https://%E4%BE%8B%E3%81%88.jp).
| Format | A link is |
|---|---|
| HTML, SVG | An <a href> around the run |
| LaTeX | \href (add \usepackage{hyperref}) |
| Typst | #link |
| RTF | A HYPERLINK field |
| DOCX, PPTX | A hyperlink on the run, its URL in the part’s relationships |
| Pandoc, Quarto | A Link |
| XLSX | The cell’s hyperlink: a cell links as a whole, to its first link. Other links in it, and a URL longer than Excel’s 2,080 characters (before or after its #), link nowhere and are reported as the unsupported feature link |
| ANSI | With color, an OSC 8 hyperlink, which a terminal without them shows as text. A cell or line links as a whole, to its first link, and other links in it are reported as link |
Raw HTML
A raw node with HTML is written as it is by HTML, and passed on as a RawInline by Pandoc and Quarto, which pandoc keeps in its HTML outputs only. Every other format draws its inline markup with the format’s own runs, and with the raw option off (for IR you don’t trust), HTML, Pandoc and Quarto do too:
b/strongbold,i/emitalic,uunderline,s/delstrike-through,code/kbdmonospace,small/big,mark,font, and astyleattribute’scolor,background-color,font-weight,font-style,font-size,font-family,text-decorationandtext-transform. A run has one decoration line: in<u><s>…</s></u>, the inner one.supandsubin Unicode superscript and subscript characters (m<sup>2</sup>is m²), when every character has one; otherwise as plain text.br, and the edges of blocks (p,div,li,tr, …), break the line; list items start with a bullet, or their number in anol.imgis an image, drawn as an image node is: only adata:URI, and nothing is fetched.awith anhrefthat is a link links its text, as a run’shrefdoes; with any otherhrefit is plain text.- Other elements keep their text; comments,
script,styleand hidden elements are dropped. Character references are decoded.
A run’s style draws as a styled_text run’s would, so what each format does with it is in the notes below (ANSI, for one, draws plain text). Content with raw markup for other formats too (raw HTML beside raw LaTeX) carries a version for each, and each writer takes only its own.
Alignment on a character
A column aligned on a character (align: "char", on align_char or a period) lines its body and summary cells up on that character, as typesetters do by hand: each cell is right-aligned and ends with invisible padding, which is the character itself for a cell without one, followed by one digit for each digit it is short of the column’s longest fraction: beside 6.789, 1234.5 ends with two hidden digits and 42 with a hidden period and three digits. A cell’s last line is measured, by the characters after the first occurrence of the character. Column labels, cells spanning columns and blank cells are right-aligned without padding, and so is every cell of a column where no cell has the character.
| Format | Padding |
|---|---|
| HTML | A hidden <span> (visibility: hidden, aria-hidden), in tabular figures |
| LaTeX | \phantom{…} |
| Typst | #hide[…] |
| SVG | Room measured in the cell’s font |
| PPTX | The characters as a run without a fill (<a:noFill/>) |
| RTF, DOCX | Figure spaces (U+2007) for digits and punctuation spaces (U+2008) for the character, as wide as the font makes them |
| XLSX | A number’s format leaves the room (_0, _.); text gets figure and punctuation spaces |
| ANSI | Spaces |
| Pandoc, Quarto | Right-aligned, unpadded: pandoc has no hidden text, and figure spaces would break its pdfLaTeX output |
Hidden text takes exactly the room the characters would, so the digits line up exactly in a font whose figures are all one width (tabular figures, as default fonts have, and as the HTML base stylesheet asks for). PPTX’s unfilled characters are still text: copied or searched, 42.0 reads 42.000. (Spaces wouldn’t do there: LibreOffice hangs spaces ending a line in the margin, where they move nothing.) In RTF, DOCX and XLSX text, a font without figure and punctuation spaces, or drawing them a size other than a digit’s and a period’s, lines the cells up only roughly.
Language and direction
A table’s lang and dir are written in each format’s own terms. Alignment and borders are physical in the IR, so a format whose “left” means “start” in a right-to-left table gets them swapped. Lines outside the grid (the title, subtitle, group labels and notes) start on the table’s start side, which is the right in a right-to-left table.
| Format | lang |
Right to left |
|---|---|---|
| HTML | lang on the container, and on <html> in a standalone document (else the locale) |
dir on the container (auto too, left to the browser). With rtl or auto, every alignment is written out, since the browser’s default is the start |
| LaTeX | ⊘ warned: the document’s language, set up in its preamble | ⊘ warned: written left to right |
| Typst | #set text(lang:, region:) in the table’s block |
#set text(dir: rtl) in the table’s block; its parts #set align(start) |
| RTF | ⊘ warned: no \lang id for the tag yet |
\rtlrow rows and \rtlpar paragraphs; \ql/\qr are physical; cell borders swap |
| SVG | xml:lang on the drawing |
The drawing is mirrored, and every line of text is direction="rtl" |
| ANSI | not written | ⊘ warned: drawn left to right |
| Pandoc | lang on the Table |
dir on the Table. Pandoc’s HTML writer writes both out; its LaTeX writer ignores them on a Table |
| Quarto | lang on the Div and the Table |
dir on both. On the Div, Pandoc’s LaTeX writer puts the table in babel or polyglossia’s otherlanguage and RTL environments |
| DOCX | <w:lang> in the document’s run defaults (styles.xml), also as w:eastAsia for Chinese, Japanese and Korean and as w:bidi for right-to-left languages |
<w:bidiVisual/> table and <w:bidi/> paragraphs. Word reads w:jc left and right, and cell borders, as start and end there, so both swap |
| XLSX | ⊘ warned: cells have no language | A rightToLeft sheet. Horizontal alignment stays physical, and left is written out, since a general-aligned cell starts on the right. Cell borders swap |
| PPTX | lang on every run (else en-US) |
The columns are written as they are seen, the first on the right, and the paragraphs are rtl="1". The table itself isn’t rtl="1", which LibreOffice and Keynote ignore. algn and cell borders are physical (a paragraph without algn is put on the right) |
The OOXML formats’ readings of left and right are from the specification, and haven’t been checked in Word or Excel yet: DOCX’s w:jc and cell borders, and XLSX’s cell borders (its alignment is physical, per ECMA-376).
Bold and italic are also set for complex-script text in every table: DOCX writes <w:bCs/> and <w:iCs/> beside <w:b/> and <w:i/>, and RTF writes \ab and \ai beside \b and \i. Without them, Word draws Arabic or Hebrew text in a bold or italic cell as regular, upright text.
Text Formats
HTML
- Semantic HTML5: a
<table>with a<thead>and a<tbody>for each row group; the heading lines and the footer are<div>s around it - A fragment for a host page, styled like gt by default: the
<style>block starts with a base stylesheet (system font, the rules above and below the table and around the column labels, spanner and row-group rules, the stub’s border, footnote and source-note sizes, padding), then the table’s own styles. The base rules use:where(), which has zero specificity, so the table’s styles and the host page’s CSS always override them.base_styles: falseleaves only the table’s own styles. Withinline_stylesthere is no<style>block, so no base look either. - A cell’s own border replaces the base rule on its edge. In a collapsed table the wider of two borders wins, so on the table’s top and bottom and under the column labels, once a cell sets its own border there, the edge is drawn by its cells: the table gets a
{prefix}_cells_top,_cells_heador_cells_bottomclass turning its rule off, and the other cells on that edge ({prefix}_rule_top,_rule_bottom) draw the rule themselves. A thin cell border then shows as drawn, not under a wider rule standalone: truewraps the fragment in a complete UTF-8 document (doctype, charset, viewport, a<title>from the table’s title), for a file opened directly in a browser. Saved.htmlfiles are fragments unless you pass it.- A
<style>block with generated class names. With thetable_idoption every rule is scoped to the table’s container (#sales .gw_table …), as gt scopes its rules, so several tables on one page can’t restyle each other; without it the rules apply to the whole page. The Python and R notebook and knitr displays give each table a random id for this - Quarto reads an HTML table in a document and writes it again with Bootstrap’s table classes, whose padding, rules and striping restyle it.
quarto_disable_processing: truemarks the table so Quarto leaves it as written; the R and Python displays turn it on - Optional inline-style mode for email/embedded contexts
- Footnote marks as
<sup>linking to their footnote - Accessibility: the stub is a row header (
<th scope="row">, orrowgroupfor a stub cell spanning rows), a row group’s label heads its rows (<th scope="colgroup">), and any cell with ascopeis a header cell with that scope; the table takesaria-labelandaria-describedbyfrom the config, andsummarybecomes its<caption>. A browser draws<th>bold: the base stylesheet keeps stubs, group labels and column labels at normal weight, so withbase_styles: falseorinline_stylesthey are bold - Header ids, as Great Tables makes them (below)
- Class names for each structural part (below)
Every structural part has a class, so a stylesheet (the host page’s) can target it. The prefix is gw unless the class_prefix option changes it, and the classes are emitted with inline styles too.
| Class | Element | Part |
|---|---|---|
gw_container |
<div> |
Wraps the whole table |
gw_title, gw_subtitle, gw_header_line |
<div> |
Heading lines above the table |
gw_table |
<table> |
The table |
gw_col_labels, gw_spanners |
<tr> in <thead> |
Column-label and spanner rows (a head row without a role counts as column labels) |
gw_col_label, gw_spanner |
<th> |
Column labels; spanner labels (filler cells in a spanner row get no class) |
gw_stubhead, gw_stub |
<th> |
Stub column cells in the head and in the body |
gw_group_label |
<th> |
A row group’s label |
gw_summary, gw_grand_summary |
<tr> |
Summary and grand summary rows |
gw_footer, gw_footnotes, gw_source_notes |
<div> |
The footer and its two blocks |
gw_footnote, gw_source_note |
<p> |
One footnote or source note |
gw_footnote_mark |
<sup> |
A footnote mark, in a cell or before its footnote |
Header cells get ids, and every other cell in the body lists the ids of its headers in headers, so a screen reader can announce them, as Great Tables does:
- Column labels take their column’s id, spanners and the stubhead their label’s text, a row group its
group_id(else its label’s text), and a stub cell its row’s number,stub-1,stub-2(stub-1-2for the second column of a stub with several). A summary row’s label issummary-{group}-{label}, a grand summary’sgrand-summary-{label}. The title and subtitle aretitleandsubtitle, and the table isaria-labelledbythe title (unless the config gives anaria-labelor asummarycaption) andaria-describedbythe subtitle (unless the config says what describes it). - An id is its text with each run of other characters than letters, digits,
_,.,:and-replaced by-; a repeated one gets a suffix (a,a-2), and footnote ids are never reused. Blank head cells get none. - A body cell’s
headerslists its group’s label (not for a grand summary), the stub cells of its row (including one spanning into it from above), then the spanners over it, top down, and its column labels. - With the
table_idoption, the container takes it as itsid, and every id above starts{table_id}-. Ids inside an SVG in a body cell are prefixed with its column and row (flag-0-clip), so the same SVG in many cells doesn’t repeat them.
Two things differ from Great Tables: stub cells are numbered in the order the rows are shown, and a subtitle gets its id with no title too.
Style classes are added alongside these as gw_style-<style id> (e.g. class="gw_title gw_style-gw_1"). That namespace can’t meet the part classes, so a style named title styles only what references it, not the title. Generated classes use a double underscore (gw__al_left, gw__c0). Style ids are plain names (the INVALID_STYLE_ID rule), and the writer never puts any other id into markup: given unvalidated IR, it gives such a style a generated gw__s<n> class instead.
LaTeX
- Uses
booktabs(\toprule,\midrule,\bottomrule); a column spanner is underlined with\cmidruleover its columns (\clinewithout booktabs) \multicolumnand\multirowfor spans- A table with more than 30 body rows (
longtable_threshold;longtable: truefor any table) is alongtable, which breaks across pages. It starts at the left margin, as a tabular does. The title, subtitle and header lines are rows of its first head, so a page break can’t separate them from the table; the column labels head every page; every page ends with the bottom rule; and the footnotes and source notes are rows of its last foot, below the last row. These rows span the table without widening it. There is no numbered\caption. Column widths settle over LaTeX runs: compile until LaTeX stops asking to rerun - Column alignment via
l,r,c; a column with a width is a paragraph column (p{…},X), aligned by\raggedright,\centeringor\raggedleft(justified only if the column isjustify), and a cell aligned apart from its column keeps the column’s width - Column widths: a fixed width is itself (
pxat 0.75pt). A%width is that share of the table’s width less every column’s padding (2\tabcolsepeach), so shares that add up to 100% fill it.frcolumns share what the others leave, in proportion: in a tabular they aretabularx’sXcolumns, and the table is exactly its width; in a longtable each one’s width is worked out from the fixed and%columns only, so natural-width columns add to the table’s width. The table’s width istable_width(default the line,\linewidth): it is the width that%andfrcolumns divide. Whentable_widthis set and no column isfr, the columns without a width are1fr, so the table is that wide; otherwise a table withoutfrcolumns keeps its natural width - Cell fills via
\cellcolor, text color via\textcolor; underline and strike-through via\uline/\sout; sizes via\fontsize - Cell borders: a horizontal edge is a line of its own between two rows (
\omitcells filled with leaders: solid, dashed, dotted or double), so a fill can’t paint over it; a vertical edge is a!{\vrule …}in the cell’s\multicolumn(a rule is always solid, so dashed and dotted sides are drawn solid). A double line’s two strokes and the gap between them are a third of its width each. Where two cells’ borders meet, one edge is drawn: the wider, then double, solid, dashed, dotted, then the one above or to the left. No packages beyond those below. - Required packages:
booktabs,multirow,longtable(long tables),tabularx(frcolumns),xcolorwith thetableoption,ulemwithnormalem(\usepackage[normalem]{ulem}, so\emphkeeps its meaning), andhyperref(links), loaded last as usual.tabularxreads its body as an argument, so raw LaTeX in a table withfrcolumns can’t use\verb - Special characters escaped:
& % $ # _ { } ~ ^ \, and< > |(which print as other glyphs in the default OT1 encoding) font_familyis written only for monospace families (\texttt, in cells and group labels): a named system font needs XeLaTeX or LuaLaTeX withfontspec, and the output also targets pdfLaTeXvertical_alignis not written: atabularrow sets its cells on one baseline, at its top. A cell spanning rows is a\multirow, centered on them- Lengths are written as given, and TeX holds none above
\maxdimen(16383.99998pt, about 5.75m): a table with a longer one, or with widths that add up to more, doesn’t compile (“Dimension too large”)
Typst
- A fragment (no page setup) that is one
#block, so it can be#included anywhere in a document (in Quarto, from a raw{=typst}block) or put in a#figure. Its set rules stay inside it, and the text after it starts a paragraph of its own. Its heading lines and notes line up with the table’s left edge (with a direction, its start), in a figure too, which centers the table. The heading lines are a sticky block, which Typst 0.13 and later keeps on the page where the table starts (0.12 can leave them on the page before) - Uses Typst’s
#table()function with named parameters table.cell(colspan: N, rowspan: N)for spans- A column spanner (a column-label cell with more column-label rows below it) is underlined with a 0.5pt rule on its bottom edge, as wide as its text area, so it stops short of the cell’s ends (by Typst’s 5pt inset) and neighboring spanners’ rules stay apart, as with LaTeX’s
\cmidrule. A blank cell gets none, and a cell whose style sets (or removes) its bottom border keeps that instead - Column widths mapped to Typst length values.
%andfrcolumns divide the table’s width: a table withtable_widthis a#blockthat wide (a%width is a share of the container), and its columns without a width are1frwhen no column is; without it, the container’s width - Styles via
table.cell(fill: ...),text(weight: "bold") - Fonts via
text(font: ("Georgia", "Times New Roman")): the whole list, in order, so Typst falls back through it - Cell borders via
table.cell(stroke: ...), solid, dashed or dotted (Typst has no double line: a double border is drawn solid) - Vertical alignment with the cell’s horizontal one (
align: left + bottom) - The title (bold, 16pt), subtitle and header lines (12pt, gray), group labels (bold on light gray) and notes (9pt; source notes gray) take their style’s text formatting (and a group label its fill) in place of those defaults
RTF
- Full RTF document with color and font tables; each font in the table is classed by its list’s generic family (
\froman,\fswiss,\fmodern), which a reader uses to pick a substitute when the font is missing - Column spans via
\cellxboundaries, row spans via\clvmgf/\clvmrg - Column widths in twips (1/1440 inch).
%andfrcolumns divide the table’s width:table_width, else the line, 6in (the document sets no page, so the reader’s default page decides; RTF’s own default, Letter with 1.25in margins, has a 6in line). Whentable_widthis set and no column isfr, the columns without a width share what the others leave; otherwise each is 1.5in, as is anfrcolumn the others leave no room for.emis 12pt. Every column is at least a twip wide, and widths that would add up to more than RTF’s largest number (about 38km) are scaled down to fit, in proportion - Cell fills via
\clcbpat; cell borders via\clbrdrt/\clbrdrl/\clbrdrb/\clbrdrr(solid, dashed, dotted, double; no table-wide rules) - Vertical alignment via
\clvertalt/\clvertalc/\clvertalb
SVG
Experimental: styling is best-effort and may change between releases (see above).
- Standalone SVG image, self-contained (no external dependencies)
- The same default look as HTML (gt’s rules, padding, sizes and text color, from one shared spec), drawn by gridwell’s own layout: the table’s styles (fills, bold, colors, cell borders and padding) still win, and an edge is drawn the way HTML draws it (a cell’s own border replaces the rule there)
- Text laid out with Roboto’s real widths (cells leave room for Arial-compatible fallbacks), and drawn with
textLength, so viewers that substitute another font keep the layout. librsvg ignorestextLength, so rsvg-based tools (Pandoc/Quarto PDF, R’s rsvg) render best with Roboto installed - Text Roboto doesn’t have (emoji, CJK, Arabic, Hebrew, …) gets estimated widths, generous enough for the fonts a viewer draws it in, and its lines are drawn at their natural width, with no
textLength. An emoji sequence (a skin tone, a family joined with ZWJ, a flag, a keycap) is measured as the one emoji it’s drawn as. Browsers draw emoji in color; librsvg draws them in one color - Body cells are vertically centered and head cells bottom-aligned, as in HTML, unless a style’s
vertical_alignsays otherwise - Known differences from HTML: a word too long for a fixed-width column is broken inside the column (HTML widens the column), and
max_widthalways clamps
ANSI (Terminal)
Experimental: styling is best-effort and may change between releases (see above).
- Box-drawing characters for borders (Unicode); rules run unbroken over and under cells that span columns
- Footnote marks as Unicode superscripts, in cells and in the notes below
- 24-bit ANSI color sequences (
true_color) - Column widths computed from content; with
max_width, the widest columns shrink until the grid fits, and text that no longer fits is cut with… - Saved to a file (
.txt), it is plain text with no escape codes unless thecoloroption is set
Pandoc
Experimental: styling is best-effort and may change between releases (see above).
- One Pandoc JSON AST block, a
Table, not a whole document - Bold, italic, underline and strike-through as
Strong,Emph,UnderlineandStrikeout, footnote marks asSuperscript, line breaks, images, raw HTML asRawInline, and cell spans and alignment. Other styles (colors, fills, borders, sizes, fonts) aren’t written, and aren’t warned for - To read it with
pandoc -f json, put it in a document’s blocks:{"pandoc-api-version": [1, 23, 1], "meta": {}, "blocks": [ … ]}(the API version gridwell’s tests read it back with)
Quarto
Experimental: styling is best-effort and may change between releases (see above).
- The Pandoc format’s
Tableblock, for Quarto’s Pandoc-based pipeline, in aDivwith the classesquarto-tableandcell-output-display - With the
table_idoption theDiv’s id istbl-<table_id>, for cross-references
Binary Formats
DOCX (Microsoft Word)
- Valid Office Open XML archive (ZIP)
- Table in
word/document.xml - Styles in
word/styles.xml: Calibri 11pt with no space between paragraphs, theTitle(16pt),Subtitle(12pt),FootnoteTextandSourceNote(9pt) paragraph styles and theTableGridtable style, so the document’s look can be changed by editing its styles in Word. A relative font size on the title or a note resolves against its paragraph style’s size - Horizontal merge via
<w:gridSpan>, vertical via<w:vMerge> - Bold, italic, color, size, font (
<w:rFonts>), shading and alignment - Table-wide single grid lines; a cell’s own borders (
<w:tcBorders>: solid, dashed, dotted, double) replace them on the sides it sets - Vertical alignment via
<w:vAlign>, on every piece of a vertically merged cell - Column widths in
<w:tblGrid>(dxa, 1/1440 inch), the table’s width their sum.%andfrcolumns divide the table’s width:table_width, else a 6in line (the document sets no page). Whentable_widthis set and no column isfr, the columns without a width share what the others leave; otherwise each is 1.5in, as is anfrcolumn the others leave no room for.emis 11pt. Every column is at least a dxa wide, and widths that would add up to more than the table’s width can hold (about 38km) are scaled down to fit, in proportion
XLSX (Microsoft Excel)
- SpreadsheetML format, written with rust_xlsxwriter. The same table makes the same file (the creation date is fixed at 1980-01-01)
- Cells preserve typed values, each shown as the table shows it:
- Numbers stay numeric, with a number format read off the display (
0.0for76.0,#,##0for1,250): with its currency or unit ("$"0.00for$49.95,#,##0.00" kg"for1,234.50 kg), as a percentage (0.0%for45.1%), in thousands or millions (0.00,,"M"for1.23M), and with its negatives shown as the table shows them ("$"0.00;"($"0.00")"for($5.00), a second section for a−). Excel shows a number’s decimal mark and thousands separators in its reader’s locale, so a display in other marks (1.234,50,1 234,5) gets the format of1,234.50: the cell is the number, in the reader’s marks. Numbers in scientific notation (1.23 × 10⁻⁴) or per mille (451.2‰) stay text. - Dates, datetimes and times are date serials, with a date format read off the display (
yyyy\-mm\-ddfor2024-03-15,mmm d\, yyyyforMar 15, 2024). Month and weekday names and AM/PM are English (the format pins en-US, so Excel shows them in English whatever its language), and literal separators are escaped (Excel would otherwise put its own date separator in place of/). The display’s digits must all be the value’s fields, and a time with fractions of a second must show them (to milliseconds). Dates before 1900-03-01 stay text: Excel counts a 1900-02-29 that never was. - Booleans are boolean cells when the display is
TRUEorFALSE(in any case: Excel shows its ownTRUEandFALSE).
<0.001,yes,Q1 2024, a footnote mark) stays text. - Numbers stay numeric, with a number format read off the display (
- Merge regions via
<mergeCells>. Every cell a merge covers has the spanning cell’s format, with the borders on its sides of the region’s outline, so the borders and fill reach the region’s edges; the region’s first cell has the whole outline - Cell borders: solid, dashed, dotted and double,
thinup to 1.5px,mediumup to 2.5px andthickabove. A border without a color is in the cell’s text color - The same rules as HTML’s default look, from one shared spec, as cell borders: the table’s top and bottom, the rules under the column labels and around group labels, between rows, right of the stub and the double rule above the grand summary; the gray rules above the title and below the notes, across the table; and the rules under spanners (unbroken between neighboring spanners, since a border can’t stop short of its cell’s ends). The table’s own borders still win: a cell’s own border replaces the rule on that edge. The sheet’s gridlines are hidden, so the rules stand alone.
base_styles: falseleaves only the table’s own borders, over the gridlines - Styles in
xl/styles.xml(fonts, fills, borders, number formats; a cell with no font of its own is in Calibri). Text is in the shared-string table, as rich text where a cell mixes formatting (each run with its full font) - A cell holds at most 32,767 characters: longer text is cut, and rich text whose formatting markup takes it over is written without its formatting (both are warned for). A table with more rows or columns than a sheet (1,048,576 by 16,384, counting the title, header lines and notes) can’t be written: rendering it is an error
- Cells with line breaks wrap, and rows are tall enough for their lines and font sizes
- Vertical alignment via the
verticalattribute; bottom, Excel’s own default, is left unstated
PPTX (Microsoft PowerPoint)
- DrawingML table (
<a:tbl>) in a slide shape - Grid-based spans with
gridSpan/rowSpanattributes - Text color, weight, slant, size and font (
<a:latin>,<a:ea>,<a:cs>), cell fills and alignment - Cell borders as
lnL/lnR/lnT/lnBlines (solid, dashed, dotted, double) - The same rules as HTML’s default look, from one shared spec: the table’s top and bottom, the rules under the column labels and around group labels, between rows, right of the stub and the double rule above the grand summary, as cell borders, so they move with the table; the gray rules above the title and below the notes, and the rules under spanners (kept apart at their ends), as line shapes drawn over it. The table’s own borders still win: a cell’s own border replaces the rule on that edge.
base_styles: falseleaves only the table’s own borders. Text color and fonts are PowerPoint’s - Vertical alignment via the cell’s
anchor - Column widths in EMU, the table centered on the slide.
%andfrcolumns divide the table’s width:table_width, else the slide’s text width (9in, as the title and notes). Whentable_widthis set and no column isfr, the columns without a width share what the others leave. Otherwise each column without a width is sized for its content, since PowerPoint, Keynote and Impress take column widths as written. It is as wide as its widest line (with the cell’s 0.1in insets), within itsmin_widthandmax_width. Spanners and group labels widen the columns they span. The text is measured with estimated widths, which run wider than Calibri and than the fonts substituted for it, so columns are a little loose rather than wrapping. When the columns would be wider than what the others leave of the table’s width, they narrow in proportion, down to their widest word. Anfrcolumn the others leave no room for is 1in.emis 18pt, PowerPoint’s table text size. Widths that would add up to more than the table’s frame can hold (about 60m) are scaled down to fit, in proportion - Row heights fit the content. Viewers grow a row to fit its text but never draw it shorter than asked, so each row is estimated: its lines wrapped at the column’s width, at spaces and after hyphens, slashes,
?and!, each line as tall as its largest text (1.22em, Calibri’s line height), plus the cell’s 0.05in insets above and below. A cell spanning rows asks them for what they lack, in equal shares. The table’s frame is as tall as its rows, so the notes start below the table - The title and notes are placed and sized the same way, stacked with the table and centered on the slide. Their boxes start at the table’s edge, so their text lines up with the cells’ (right to left, they end there). Each box runs to the slide’s far margin, and starts nearer the near margin when its widest line needs more room
- A complete package (theme, master color map, notes size), so PowerPoint and Keynote open it