Message Boards Message Boards

3
|
11607 Views
|
10 Replies
|
13 Total Likes
View groups...
Share
Share this post:

TableView improvement suggestions

TableView does not allow the deletion of a cell. Am I misunderstanding the usefulness of this function? Should it only be used to visualize a matrix or is it also intended to edit, add and remove cells?

table123 = RandomChoice[{True, False}, {4, 4}];
TableView[Dynamic[table123], AllowedDimensions -> {6, 6}]

... TableView Output ...

Dynamic[table123]

Any changes to the table are immediately visible in the output of the Dynamic[table123] command. Further cell content is easily added and the rectangular matrix grows. However, deletions and subsequent shrinkage of the matrix do not work. One can note that the last character that one tries to delete in a filled cell cannot be removed.

10 Replies

On a slightly different tack, could options be provided to allow the content of table cells to be aligned (e.g. Alignment->Left) and wrapped when too large to fit the cell. It would also be useful to be able to specify row and column headings.

POSTED BY: Ian Williams

The first thing I tried when testing TableView was to copy data from Excel to TableView and vice versa. Unfortunately it’s not possible.

POSTED BY: Rodrigo Murta

TableView does not allow the deletion of a cell.

This slipped through the cracks and will be fixed shortly.

POSTED BY: Jason Abernathy
Posted 4 years ago

The following additional issues make TableView[] rather useless (to me):

  • copy & paste works flawlessly within the TableView, but not from Excel or LibreOffice (\t and \n separated, instead the whole cell range is pasted into one cell)
  • copy & paste does not work at all when the TableView is displayed in a dialog

TableView[] has great potential for interactive input, but is not useable now. I wonder what Wolfram intended users to do with it in its current state.

POSTED BY: Stefan Popien
Posted 4 years ago

The following works. Replace cells to be deleted with "x" and press "OK", which will display a new TableView with the cells deleted. Pressing "Cancel" closes the dialog and the final data can be read from "table".

res=True;
While[res,
  res=ChoiceDialog[TableView[Dynamic[table],AllowedDimensions->{5,5}]];
  If[res,
    (table[[Sequence@@#]]=Null)&/@Position[table,"x",{2},Heads->False];
    table=Replace[table,{{Null..}->{},{x__,Null..}:>{x}},{1}];
    While[table[[-1]]==={},table=table[[;;-2]]]
    ]]

Hope it will be of use! / Hoffe es ist von Nutzen!

POSTED BY: Stefan Popien
Posted 4 years ago

The following kinda works, but apparently the TableView does miss some updates to "a" and even worse, then reverts them. So still not that useful.

Manipulate[
 TableView[Dynamic [a]], {del, "1,1", InputField[#, String] &}, 
 Button["delete", 
  a[[Sequence @@ ToExpression@StringSplit[del, ","]]] = Null]]
Dynamic@a
POSTED BY: Stefan Popien

Thank you for the reply. I had hoped, I had made a mistake. In its current state, TableView[] is completely useless.

Posted 4 years ago

I was quite disappointed by this behavior as well. When I read about TableView[] I immediately updated to 12.1, hoping to be able to build an easy to sue interface for data import.

But with TableView[] ignoring cell deletion this seems not feasible.

I wonder why the implementation was chosen to be like it is now.

POSTED BY: Stefan Popien

Funny things in TableView :)

TableView[Table[{n, N[ZetaZero[n], 5]}, {n, 1, 100}], ItemSize -> {15, 1}, AllowedDimensions -> {2, 100}]

Scroll Down to the end and See RED boxes. Scroll Up at the beginning and see No data in the Column 2.

Regards :)

POSTED BY: Mariusz Iwaniuk
Posted 4 years ago

Thanks for the pointer, I've reported this to the appropriate development team.

POSTED BY: Kyle Martin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract