[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
Fri May 28 05:49:26 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=38664





--- Comment #7 from Jan Odvarko <odvarko at gmail.com>  2010-05-28 05:49:25 PST ---
One addition. It could be quite useful if there is a way how to provide the header information without modifying the original data being logged using console.table();

Firebug implementation now supports following usage scenarios:

- console.table(array2D)  // as proposed.
- console.table("My table", array2d);
- console.table("My tables", array2d-1, array2d-2);

Since there is a support for multiple arguments/tables (to be more inline with the other console methods), it could be painful to add another argument that contains the header info.

Instead I have been thinking about formatted string provided as part of the optional first message parameter. Here are some examples:

- console.table("My table %Col1 %Col2 %Col3", array2d);

In this case there would be three columns "Col1", "Col2" and "Col3" automatically created

- console.table("My table %Col1 %Col2 %Col3", array2d-1, array2d-2);

If there is more arguments/tables they would share the same column set.

If the formatted cols are not provided, the first row in the data would be expected to define the header, just like originally proposed.

This could be perhaps too much but in case of more tables the formatted string could specify different sets of headers, something like as follows:

- console.table("My table [%Col1 %Col2 %Col3] [%Col1 %Col2]",
array2d-3cols, array2d-2cols);

Perhaps, the syntax could be yet improved.

What do you think?
Honza

-- 
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