TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The design philosophy of Great Tables

504 pointsby randyzwitchabout 1 year ago

45 comments

paddy_mabout 1 year ago
Great tables has done some really nice work on python&#x2F;jupyter tables. It looks like they are almost building a &quot;grammar of tables&quot; similar to a grammar of graphics. More projects should write about their philosophy and aims like this.<p>I have built a different table library for jupyter called buckaroo. My approach has been different. Buckaroo aims to allow you to interactively cycle through different formats and post-processing functions to quickly glean important insights from a table while working interactively. I took the view that I type the same commands over and over to perform rudimentary exploratory data analysis, those commands and insights should be built into a table.<p>Great tables seems built so that you can manually format a table for presentation.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;paddymul&#x2F;buckaroo">https:&#x2F;&#x2F;github.com&#x2F;paddymul&#x2F;buckaroo</a><p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;GPl6_9n31NE" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;GPl6_9n31NE</a>
评论 #39937256 未加载
jszymborskiabout 1 year ago
The example they show of a Great Table is, to my taste, way too busy. Here is my unsolicited opinion:<p>The top and bottom horizontal rules on the Title appear to be superfluous, and I dislike how it is aligned with the first column (row labels) rather than the second. I feel like a little space to breath at the bottom, along with a bold font would add visual hierarchy w&#x2F;o the clutter.<p>The row label backgrounds are far too dark and the font weight makes it hard to read. I&#x27;d prefer a very light blue here instead. I don&#x27;t like the row group label (&quot;Name&quot;) being italicized.<p>The spanner labels floating in the centre make the table hard to scan. Would be much nicer aligned left.<p>Finally, I really dislike the font (maybe this is just my browser, though).<p>I mocked-up some of the changes here, I think this is a much easier to read table:<p><a href="https:&#x2F;&#x2F;i.imgur.com&#x2F;iMMf5vo.png" rel="nofollow">https:&#x2F;&#x2F;i.imgur.com&#x2F;iMMf5vo.png</a>
评论 #39936405 未加载
评论 #39940446 未加载
评论 #39935900 未加载
评论 #39941926 未加载
评论 #39936134 未加载
评论 #39936217 未加载
评论 #39935507 未加载
wglbabout 1 year ago
This a good article with some fascinating history.<p>More recent history involves the production of CALS tables <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;CALS_Table_Model" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;CALS_Table_Model</a>. The company Datalogics <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Datalogics" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Datalogics</a> was heavily involved in the CALS table initiative. Datalogics staff was part of the ISO committee forming SGML, and trained many people on SGML, including DoD staff and their contractors involved with documentation.<p>I was involved with the team that produced an editor for SGML-based documents. It had as one of its features the ability to specify the formatting of an element based on the SGML context of that element. This was before XSLT and its kin.<p>Alumni of Datalogics helped Microsoft learn about XML (&quot;No, you can&#x27;t arbitrarily switch case on XML element tags&quot;).<p>Also TeX practitioners have pretty well-formed opinions about how tables should be formatted.<p>Odd side-note: I learned that the documentation for a fighter airplane of the time, if printed out, would weigh more than the aircraft and would fill a football-field sized collection of filing cabinets.<p>And as much as many today don&#x27;t like XML, coming from the SGML world it is a boon.
评论 #39942323 未加载
jiggawattsabout 1 year ago
Something that always annoyed me about numeric data like dollar amounts in tables is that <i>visually</i> the comparison between quantities is logarithmic instead of linear.<p>E.g.:<p><pre><code> Cost $1500 $130 $110 $210 </code></pre> The text in the last three rows look 4&#x2F;5ths the size of the text in the first row. However, even if summed, the last three costs add up to only 1&#x2F;3rd of the top row! People visually see the number digits, which is roughly the same as Log 10.<p>I’ve so often had this issue that I started putting in-cell bar charts into every finance-related spreadsheet.<p>Otherwise meetings will get derailed debating the cost of something trivial that is totally irrelevant compared to the biggest absolute costs.<p>As a real example, I had many meetings spent debating a $15 monthly cost for server log collection in the cloud for a VM running a database engine that costs $15K monthly for the license alone.
closedabout 1 year ago
Hey one of the co-maintainers of Great Tables, along with Rich Iannone, here!<p>I just wanted to say that Rich is the only software developer I know, who when asked to lay out the philosophy of his package, would give you 5,000 years of history on the display of tables. :)
ttymckabout 1 year ago
Wow. This looks incredible, thanks for sharing.<p>It makes me wonder how we&#x27;ve gone this long with increasingly <i>poor</i> data table presentations (the mid-century modern tables are astutely pointed to as shining examples).<p>This makes me excited to get back into data analysis with python. Moreover, I see some possible API improvements and extensions I&#x27;d like to make.
countrymileabout 1 year ago
I love this package and have been using it for a few years in R. It&#x27;s great [for making] tables in html but the pdf and docx output is a little less polished. I do worry that the recent shift to bringing the python version up to speed with the R version has slowed down the R development. Though it&#x27;s well worth checking out whatever your language.
AvAn12about 1 year ago
Wonderful! In the 90s a colleague and I wrote a book (EBRI Datebook on Employee Benefits) which was mostly tables. In addition to SAS, our other primary tool was an ancient language called Table Producing Language (&quot;TPL&quot;). Despite dating back to the 1970s, TPL was incredibly flexible, expressive, and efficient - once you figured out the syntax.<p>The designers of Great Tables might want to check out TPL. It covers everything Great Tables aims to do, and I think may have a few more tricks up its sleeves:<p><a href="https:&#x2F;&#x2F;www.ojp.gov&#x2F;pdffiles1&#x2F;Digitization&#x2F;68013NCJRS.pdf" rel="nofollow">https:&#x2F;&#x2F;www.ojp.gov&#x2F;pdffiles1&#x2F;Digitization&#x2F;68013NCJRS.pdf</a><p>Regardless, thanks for making Great Tables! This goes a long way towards making table producing in python much better.
benterixabout 1 year ago
This guy deserves some prize for 1) great work, 2) attention to detail, 3) in-depth research, 4) excellent presentation of his work (sparing the usual questions like &quot;but what is it, really?&quot;, &quot;how do I start?&quot;, &quot;can you provide some examples?&quot;).<p>People from Show HN - watch and learn.
antidnanabout 1 year ago
There&#x27;s also a book on the subject: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;The_History_of_Mathematical_Tables" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;The_History_of_Mathematical_Ta...</a><p>Interesting aside: AI models trained on spreadsheets need &quot;good tables&quot; such as column names, headers, etc. to understand context. Like Fortap: <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2109.07323" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2109.07323</a>
评论 #39935029 未加载
jimhefferonabout 1 year ago
I&#x27;m interested in the midcentury modern ones because they have lots of vertical rules. I&#x27;m active on the subreddit for LaTeX and there is a religion common there that even one vertical rule is an unforgivable abomination.
评论 #39935127 未加载
flobosgabout 1 year ago
Regarding “nanoplots”: they are essentially sparklines, aren’t they?
评论 #39935744 未加载
xnxabout 1 year ago
Tables are underutilized for how concise and descriptive they can be when making comparisons. It&#x27;s a shame most text editors start with a blank table instead of inserting one pre-configured with some good design choices.
评论 #39939619 未加载
simonbarker87about 1 year ago
This looks great. I so wish that the HTML table element would get some progress - it’s so limited.<p>I don’t want to have to use some JS library component just to show tabular data especially given how badly they perform one big - but a server side rendered HTML table can be enormous and render fine. But again, so limited.
评论 #39936271 未加载
eviksabout 1 year ago
Would be great if the example tables were great for such a post. Like their remote correspondent&#x27;s table: they&#x27;ve actually made it partially worse in the &quot;great tables&quot; style:<p>- now the dates are not vertically aligned, and<p>- the weights have repetition of units (lbs) (although losing the decimal is an improvement)<p>- the name column is way too visually &quot;heavy&quot;, that&#x27;s a style you&#x27;d reserve for a header, a simple bold would suffice<p>They&#x27;ve also retained other issues from the original like city not being a city, but a combo of city and region, or similarly no separation of the first name of a person, which is especially important for a diverse group of people
mcswellabout 1 year ago
Not mentioned yet are DocBook tables, of which there are several types. The kind we used starts here: <a href="https:&#x2F;&#x2F;tdg.docbook.org&#x2F;tdg&#x2F;5.1&#x2F;cals.table" rel="nofollow">https:&#x2F;&#x2F;tdg.docbook.org&#x2F;tdg&#x2F;5.1&#x2F;cals.table</a>. You have to drill down to get inside the tables. They have some--but I think not all-- the structure of GT.<p>There&#x27;s also of course LaTeX (mentioned in a couple other comments here), which has &quot;ordinary&quot; tables and long tables (tables that span more than one page).
sebastiansmabout 1 year ago
It&#x27;s great that the RStudio team is working on Python libraries.<p>Hope to see dplyr and ggplot someday on Python.
评论 #39934305 未加载
评论 #39934325 未加载
crispyambulanceabout 1 year ago
I really like great tables and its cousin in R, gt. You know they&#x27;re taking a long view when there are photos of CLAY TABLETS and VISI-CALC in the article. Bravo!<p>Tables, when you really care, are so very difficult to get right. Sometimes you really want to densely compact the data to communicate all details to others who are already deeply invested in the dataset, sometimes you need to remove all but the most essential information to get across a single idea with clarity, and then there are a continuum of variations between those extremes. The problem expands into more dimensions when the media becomes a consideration-- you simply can&#x27;t (and should not) use the same approach when dealing with pdf&#x27;s vs html vs a slide-deck. On top of all that, you often have a personal style that you want to get across, or have a style that you need to comply with in some inflexible way.<p>I like how gt just NAMES the parts of table in their docs (and in the schematic in the article). This is a problem where agreeing on what things are called makes a ton of difference in usability.
lqetabout 1 year ago
Here is a very short guide on how to make nice tables (which, IMHO, look a lot better than the visually cluttered &quot;Great Table&quot; example from the article) for scientific papers:<p><a href="https:&#x2F;&#x2F;people.inf.ethz.ch&#x2F;markusp&#x2F;teaching&#x2F;guides&#x2F;guide-tables.pdf" rel="nofollow">https:&#x2F;&#x2F;people.inf.ethz.ch&#x2F;markusp&#x2F;teaching&#x2F;guides&#x2F;guide-tab...</a>
bigger_cheeseabout 1 year ago
I Use SAS reports in my job pretty heavily I&#x27;m keen to find alternatives - this looks pretty promising.<p>One thing in particular I&#x27;m interested in but could not see an example for is if this will let you insert &quot;break lines&quot; i.e. for displaying sub totals and similar.<p>For example based on the demo, which shows names and addresses from census data it might be nice to be able to break at each change in postcode and display some summary data like a count of people found at that postcode or an average age (based on the DOB) living at that postcode or similar.<p>Otherwise conditional formatting is another pain point either using rules i.e. if value in column B is greater than a specified threshold make the entire row bold. Or automatically creating a color gradient to highlight the cells ala Excel.<p>For bonus points management types like things like red and green traffic lights (or down&#x2F;up arrows) you can display next to kpi data in a table It&#x27;s a gimmick but wins you points.
tqwhiteabout 1 year ago
I want to praise the Great Tables people for having created an excellent marketing piece. It is a lesson in how to engage people in a product announcement. I started reading the article and by the time they started explaining the product, I was sincerely interested in knowing about it.
acrophiliacabout 1 year ago
While I&#x27;m waiting for the packages to download, can you explain how I get tabular output when I run a python application using your package at the command line? Does it produce HTML output? PDF? Your &quot;getting started&quot; docs doesn&#x27;t explain.
评论 #39934360 未加载
throwaway81523about 1 year ago
This article is mostly blither, whether or not it is AI generated. It is about a Python library for generating nicely formatted HTML tables, though they don&#x27;t tell you much about it til the near the end. The library seems to use an OOP approach. An alternative approach might be more declarative. The product name &quot;Great Tables&quot; appears in boldface over and over (no idea if the font helps SEO) and the name itself is awfully pretentious imho. Overall, the library itself sounds ok,, but the blog post is the annoying market-speak that frequently makes me cringe here on HN.<p>It would be nice to add some interactivity features to the tables, like ActiveAdmin in Rails.
评论 #39934428 未加载
评论 #39943416 未加载
ewuhicabout 1 year ago
There was some design blog post several years ago, maybe not even surfaced on HN:<p>Creating beautiful tables both UI and UX wise, with some features being e.g dropping separator between columns (row?), doing some visual accents, etc.<p>And yes, the most distinguished feature was that the tables weren&#x27;t looking like your busy PowerPoint non-tech organisation stuff, they were very modern yet simple.<p>I don&#x27;t remember the specifics, but I was really impressed and regret not bookmarking the article.<p>Does anyone know of the article in question, and maybe could share the link?
评论 #39940248 未加载
评论 #39952811 未加载
hipjiveguyabout 1 year ago
The best thing anyone can do with tables is make it so people use tables Not &quot;divs&quot; - tables, can be parsed, and exported to other data formats easily, and are easy to recognize, without visualization.<p>Many websites build tables out of div&#x27;s, and they may look like tables, but they are hard to manipulate&#x2F;export data from.<p>If a table is on a website, I feel it should be easy to export it as csv, at the least, to &quot;free the data&quot; :D
sandbachabout 1 year ago
The documentation of the LaTeX package booktabs[0] is a great resource for anyone interested in beautiful table design.<p>[0] <a href="http:&#x2F;&#x2F;mirrors.ctan.org&#x2F;macros&#x2F;latex&#x2F;contrib&#x2F;booktabs&#x2F;booktabs.pdf" rel="nofollow">http:&#x2F;&#x2F;mirrors.ctan.org&#x2F;macros&#x2F;latex&#x2F;contrib&#x2F;booktabs&#x2F;bookta...</a>
seanwilsonabout 1 year ago
How does this compare to <a href="https:&#x2F;&#x2F;github.com&#x2F;jieter&#x2F;django-tables2">https:&#x2F;&#x2F;github.com&#x2F;jieter&#x2F;django-tables2</a>? That one makes it really easy to display database models as HTML tables with column sorting and pagination, and search&#x2F;filtering can be added on top with django-filter.
RyanHamiltonabout 1 year ago
If anyone is looking for a great open source table, I recommend slick grid: <a href="https:&#x2F;&#x2F;github.com&#x2F;6pac&#x2F;SlickGrid">https:&#x2F;&#x2F;github.com&#x2F;6pac&#x2F;SlickGrid</a> it has all the features shown in the article and has proven itself capable of everything I&#x27;ve needed for the last 2+ years.
Narannabout 1 year ago
Nothing in the product page explains how you generate the HTML code and&#x2F;or the image.
评论 #39939685 未加载
thih9about 1 year ago
I am missing a section on UX best practices and in particular: intuitive and touch friendly solution for multi column sort.<p>All approaches I’ve seen here have some issues; worst of all being “press shift to sort by multiple columns” (not touch friendly).
评论 #39945036 未加载
two_handfulsabout 1 year ago
Summary:<p>This article is about a Python library called “Great Tables” that is focused on the display of tables for publication and presentation (not for interactive browsing).<p>The article does not specify which output format it supports.<p>Also you get some bonus historical context on tables.
评论 #39935778 未加载
pphyschabout 1 year ago
The generated HTML for the tables looks pretty good. How easy is it to attach extra classes to the elements? Is cell content HTML-escaped by default?
shymapleabout 1 year ago
Awesome, recently we started working on table functionality for one of our feature and your post is really helpful. Thanks!
hughessabout 1 year ago
Great article and big fan of this approach.<p>I&#x27;m one of the maintainers of Evidence (open source tool based on markdown + SQL) and working on a similar approach to creating presentation tables configurable in code.<p>Some examples here for any SQL + table enthusiasts: <a href="https:&#x2F;&#x2F;docs.evidence.dev&#x2F;components&#x2F;data-table">https:&#x2F;&#x2F;docs.evidence.dev&#x2F;components&#x2F;data-table</a>
golergkaabout 1 year ago
Before clicking the link I was wondering if it&#x27;s about relational schemas or woodworking.
WuxiFingerHoldabout 1 year ago
I overall like the approach for complex scenarios but their example is not the best one. The original version is much more readable and their final version adds mostly noise.<p>Also, in documents all images and tables should have descriptive captions. So their header with title and subtitle would be redundant.
semiregabout 1 year ago
Does anyone know any similar projects that can render to an HTML canvas?
评论 #39935357 未加载
throw_m239339about 1 year ago
This was surprisingly informative and entertaining.
narushabout 1 year ago
This is an excellent blog post - I&#x27;d never heard of Great Tables before, and I&#x27;m a newly minted fan!<p>&gt; confronted with an all-too-familiar dilemma: copy your data into a tool like Excel to make the table, or, display an otherwise unpolished table.<p>One add-on (coming from the past 4 years of working on a tabular-data from Pythons startup [1]) is that users aren&#x27;t just copying data into Excel because if it&#x27;s good formatting capability: very often, there are organizational constraints that mean that Excel _needs_ to be where this data ends up.<p>The most common reasons I&#x27;ve seen for data ending up in Excel: 1. Other parts of the report rely on Excel features - you want to build pivot tables or graphs in Excel (often, these are much easier to build in Excel than in Python for anyone who isn&#x27;t a real Pythonista) 2. The report you&#x27;re sending out for display is _expected_ in an Excel format. The two main reasons for this are just organizational momentum, or that you want to let the receiver conduct additional ad-hoc analysis (Excel is best for this in almost every org).<p>The way we&#x27;ve sliced this problem space is by improving the interfaces that users can use to export formatting to Excel. You can see some of our (open-core) code here [2]. TL;DR: Mito gives you an interface in Jupyter that looks like a spreadsheet, where you can apply formatting like Excel (number formatting, conditional formatting, color formatting) - and then Mito automatically generates code that exports this formatting to an Excel. This is one of our more compelling enterprise features, for decision makers that work with non-expert Python programmers - getting formatting into Excel is a big hassle.<p>Of course, for folks who can ditch Excel entirely, this is entirely unnecessary. Great Tables seems excellent in this case (and anyone writing blog posts this good is probably writing good code too... :) )<p>[1] <a href="https:&#x2F;&#x2F;trymito.io">https:&#x2F;&#x2F;trymito.io</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;mito-ds&#x2F;mito&#x2F;blob&#x2F;dev&#x2F;mitosheet&#x2F;mitosheet&#x2F;public&#x2F;v3&#x2F;formatting.py">https:&#x2F;&#x2F;github.com&#x2F;mito-ds&#x2F;mito&#x2F;blob&#x2F;dev&#x2F;mitosheet&#x2F;mitosheet...</a>
评论 #39942822 未加载
boringgabout 1 year ago
I was really looking forward to a discussion about beautiful wood tables. I should have known better
snappr021about 1 year ago
Contenteditable?
jamesdutcabout 1 year ago
The historical background about tabular displays of quantitative information is very interesting. I imagine it must have been fun think deeply about this problem.<p>Unfortunately, the API design in the example is just not very good:<p><pre><code> ( GT(simple_table, rowname_col=&#x27;Name&#x27;) .tab_header(title=&#x27;Names, Addresses, and Characteristics of Remote Correspondents&#x27;) .tab_stubhead(label=md(&#x27;*Name*&#x27;)) ... ) </code></pre> I&#x27;m uncertain if it&#x27;s trying to mimic something in another language like R (or some grammar of graphics thing or D3.js.) Hopefully, it&#x27;s not trying to mimic the look of long, chained `pandas.DataFrame` operations (because it misses the point of why those look the way it does.)<p>Of course, for ad hoc, in-a-notebook, cut-and-paste&#x2F;written-from-scratch use, the API design doesn&#x27;t really matter that match. Usually, users will readily memorise the required incantations then fiddle with the result until they get what they want or they give up.<p>It&#x27;s probably the case that for most tools that produce visual outputs, a majority of users are creating things in this style. (There are, e.g., millions of casual Matplotlib users out there.) But programmatic use is not too far off. Tools that produce visual outputs (even those as formally rigidly at display tables,) are often subject to consistency requirements, which directly implies programmatic use.<p>So, when I discover that my colleagues and I have six tables across three notebooks that need a consistent look, and I decide to interact with this tool programmatically, am I expected to write…?<p><pre><code> def standard_table(source, &#x2F;, rowname_col, header_title, stubhead_label, weight_columns): return ( GT(source, rowname_col=rowname_col) .tab_header(title=header_title) .tab_stubhead(label=md(f&quot;*{stubhead_label}*&quot;)) .fmt_integer(columns=weight_columns, pattern=&quot;{x} lbs&quot;) ... ) standard_table(simple_table, rowname_col=&#x27;Name&#x27;, header_title=&#x27;Names, Addresses, and Characteristics of Remote Correspondents&#x27;, stubhead_label=&#x27;Name&#x27;, weight_columns=&#x27;Weight&#x27;) </code></pre> Or maybe…?<p><pre><code> def format_table(weight_columns): return ( tbl .tab_stubhead(label=md(f&quot;*{tbl.stubhead.label}*&quot;)) # what if not present? .fmt_integer(columns=weight_columns, pattern=&quot;{x} lbs&quot;) ... ) format_table( GT(simple_table, rowname_col=&#x27;Name&#x27;) .tab_header(title=&#x27;Names, Addresses, and Characteristics of Remote Correspondents&#x27;) .tab_stubhead(label=&#x27;Name&#x27;) ... ) </code></pre> Or maybe…?<p><pre><code> class StandardTable(GT): def tab_stubhead(self, *a, **kw): # inspect.signature.bind(...) # ... return super().tab_stubhead(*a, **kw) StandardTable(...) </code></pre> These aren&#x27;t great options. The API design is just not very good.
tonymetabout 1 year ago
Imagine the web if every site was exclusively tabular. No UIs just a table of figures and a CRUD for modifying it. Something like hypercard meets excel
评论 #39939768 未加载
评论 #39935645 未加载
magnioabout 1 year ago
TLDR: you can create booktabs-style tables in Python.<p>Strange that they did not know (or credit) booktabs, the LaTex package that popularizes this table design since 2003.
tomcamabout 1 year ago
Fantastic article, duly bookmarked. However.<p>“The democratization of computational tables arguably began with VisiCalc in 1979… I mean, try it out and you’ll see that this is quite limited in more than a few ways.”<p>Them’s fightin’ words. IMHO VisiCalc’s ability to generate models quickly changed civilization. It freed people to try out ideas at no cost and to view or manipulate data in ways no one could hope to do before.
评论 #39939432 未加载