Skip to content

Commit 2308c5f

Browse files
committed
update README with fill/align changes
1 parent 518e6c5 commit 2308c5f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,10 @@ Another example (summing columns):
490490
- **Note:** If more rows than specified are added, the height for the **last row** will be the one assigned to all extra rows. (If the last row is `auto`, the extra ones will also be `auto`, for example.)
491491
- **Warning:** support for fractional sizes for rows is still rudimentary - they only work properly on the table's first page; on the second page and onwards, they will not behave properly, differently from the default `#table`.
492492
- `inset`: Inset/internal padding to give to each cell. Defaults to `5pt` (the `#table` default).
493-
- `fill`: Color with which to fill cells' backgrounds. Defaults to `none`, or no fill. Must be either a `color`, such as `blue`, or a function `(column, row) => color` (to customize for each individual cell).
493+
494+
- `align`: How to align text in the cells. Defaults to `auto`, which inherits alignment from the outer context. Must be either `auto`, an `alignment` (such as `left` or `top`), a `2d alignment` (such as `left + top`), an `array` of alignment/2d alignment (one for each column in the table - if there are more columns than alignment values, they will alternate); or a function `(column, row) => alignment/2d alignment` (to customize for each individual cell).
495+
496+
- `fill`: Color with which to fill cells' backgrounds. Defaults to `none`, or no fill. Must be either a `color`, such as `blue`; an `array` of colors (one for each column in the table - if there are more columns than colors, they will alternate); or a function `(column, row) => color` (to customize for each individual cell).
494497
495498
- `stroke`: Indicates how to draw the table lines. Defaults to the current line styles in the document. For example: `5pt + red` to change the color and the thickness.
496499
@@ -541,6 +544,9 @@ Another example (summing columns):
541544
542545
### Unreleased
543546
547+
- Added support for Typst v0.4.0 and v0.5.0.
548+
- The tablex options `fill:` and `align:` now accept arrays of values for each column (https://github.com/PgBiel/typst-tablex/issues/13).
549+
- For example, `fill: (red, blue)` would fill the first column with red, the second column with blue, and any further columns would alternate between the two fill colors.
544550
- Fixed the calculation of the size of `auto` rows and columns when a rowspan or colspan was used (https://github.com/PgBiel/typst-tablex/issues/11).
545551
- Fixed the calculation of the size of the last `auto` column when it was too long (https://github.com/PgBiel/typst-tablex/issues/6).
546552
@@ -578,9 +584,11 @@ Initial release.
578584
- [X] `fill`
579585
- [X] Basic support (`color` for general fill)
580586
- [X] Accept a function (`(column, row) => color`)
587+
- [X] Accept an array of colors (one for each column)
581588
- [X] `align`
582589
- [X] Basic support (`alignment` and `2d alignment` apply to all cells)
583590
- [X] Accept a function (`(column, row) => alignment/2d alignment`)
591+
- [X] Accept an array of alignment values (one for each column)
584592
- [X] `inset`
585593
- [ ] `gutter`
586594
- [X] Basic support

0 commit comments

Comments
 (0)