Approaches to HTML table generation
See original GitHub issueThis ticket is to gather requirements and solicit ideas on drawing HTML tables from Vega, possibly with a new html-table oriented renderer, possibly as a Vega plugin.
Goal
Allow users to generate HTML tables from the data after being processed by the Vega transformations, including interactivity.
Approaches
One possible approach is to have a new cell mark. Having this mark automatically creates an HTML table. The table could be positioned either underneath the <canvas> or <svg> element, or on top of it (TBD - multiple layers?). Multiple cell marks could target either one or multiple output tables. Using groups it may be possible to draw tables inside other tables.
Sizing
Table should occupy the entire space of the container (autosize=fit), or be the same size as the graph (autosize=none and pad).
Parameters
name– ID of the marktable– ID of the table - multiple marks could have the same table IDcolumnandrow(instead of x,y) - integer cell position within a table. The table will dynamically grow whenever the column or row values exceed currently allocated space.rowspanandcolspan– same as HTML table’s params.- From the text mark:
align,baseline,dir,ellipsis,font,fontSize,fontWeight,fontStyle,limit,text border– TBD
Open questions
- Table-level parameters - should there be a top-level and group-level
tablessection, similar to data? Table nesting based on groups? - Multiple tables vs a single table - should there always be a single table (similar to how width/height always refer to the main drawing area), or should it be possible to draw multiple ones, and allow table positioning?
- specifying headers/footers - could be done by a separate
cellmark targeting the same table and using bold font
Issue Analytics
- State:
- Created 5 years ago
- Reactions:21
- Comments:25 (9 by maintainers)

Top Related StackOverflow Question
This would be a great feature. waiting for it.
@domoritz do you mean something like this?
So vega-embed will have not only canvas but tables section?