[Webkit-unassigned] [Bug 38664] Web Inspector: add a "table" method to console, to allow output of tabular data

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 1 10:05:07 PDT 2010


--- Comment #30 from Jan Odvarko <odvarko at gmail.com>  2010-06-01 10:05:06 PST ---
(In reply to comment #29)
> (In reply to comment #15)
> > 6) Expandable log
> > var object = {father: {name: "Mike", age: 30}, son: {name: "John", age: 5}};
> > console.table("My Family", object);
> > 
> > + My Family
> > 
> > The user needs to expand to see the actual data.
> I'm still not convinced of the need for the title passed as a parameter.  I see two primary use cases:
> - iterative calls in the console REPL
> You have some data, you just want to dump it.  You don't care about a title, and you certainly don't want the data display in a contracted form that you HAVE to expand to see - you just want to see it.
> - elaborate calls from your scripts
> You may have some data that you'd like to have really nicely formatted, with headers, grouped, etc, which you encode directly in your script so you don't have to type it all the time.  In this case, wrappering your table.console() call(s) with console.group()/console.groupEnd() doesn't seem like such a huge burden to me.

Yes both uses cases are correct.

The original point was related to the other console methods that mostly takes a string/label as the first parameter, but looking at the list again we can see that console.dir() and console.dirxml() also doesn't expect a label and so, the developer needs to use them together with console.group() in order to make them expandable. It looks like the console.table() could also fall to this category.

So following needs to be written if the label parameter is avoided:
console.group("My Table")
console.table(object, [columns and headers definition]);

So, thinking about this again, it's ok for me if the parameter is not there, it'll be probably easier.


Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list