The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Logging Pretty-Printing Tabular Data to the Console

Logging Pretty-Printing Tabular Data to the Console

3:09
Learn how to use console.table to render arrays and objects in a tabular format for easy scanning over the values. We'll create some mock data and then render it to the log in various ways to explore console.table's API.
Watch this lesson now
Avatar
egghead.io

Learn how to use console.table to render arrays and objects in a tabular format for easy scanning over the values. We'll create some mock data and then render it to the log in various ways to explore console.table's API.

Avatar
Hunter

Very nice course; It looks like console.table is probably built using console.log("%csomething", magic css here); It would be wonderful to get a breakdown of how that's written, or if magic can be made to happen via the console.log css stuff, a demonstration would be cool.

Avatar
Ferenc

Another quick tip: i use a wrapper function log() which JSON.stringifies the output so it gives a prettyfied version that shows the structure at first glance

Avatar
Raphi

This was a really nice mini course

Avatar
Eric

Love it. I can't believe I didn't know this was a thing.

Avatar
Jonathan

Great course. I was really hoping, though, for a video on 'console.dir', which is sometimes handy for dissecting thrown Errors. I wonder what else it can be used for.

Avatar
ANGELO

Very useful way to show data. I think it's important to remember that this method is not yet standard and not available in all major browsers. Use Chrome to enjoy it.

Thank you for useful lessons at all. Any plans to talk about strategies to manage console in production environment?

Avatar
Hozefa

Looks like Chrome has dropped support for console.table

In reply to egghead.io
Avatar
Nabil

I've just tested it and it still works?

In reply to Hozefa
Avatar
James

Are you sure? I use it in Chrome all the time.

In reply to Hozefa
Avatar
James

Thanks for the course! :)

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?