Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.8K Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Bug in Dataset Alignment option for Center (still in version 14.2)

Posted 4 years ago
POSTED BY: Rodrigo Murta
3 Replies

Unfortunately, it still doesn’t work, even on version 14.2. When I use {Center, Center}, it does center, but the vertical spacing between lines changes, disrupting the layout of the dataset.

Attachment

POSTED BY: Rodrigo Murta
Posted 1 year ago

Try this:

Dataset[
  {<|"colA"->1,"colB"->2,"colC"->3|>,<|"colA"->4,"colB"->5,"colC"->6|>},
  Alignment->{"colA"->Right,"colB"->{Center,Automatic},"colC"->{Center,Automatic}}
]
POSTED BY: Hans Milton
Posted 4 years ago

Well, I'm not entirely sure why, but Dataset seems to need both vertical and horizontal alignments to be specified. In the documentation, the default Alignment for Dataset is {Left,Baseline}. Maybe when you just set Alignment->Center all it does is replace Baseline with Center. I don't know. But anyway, if you use a pair for Alignment, the Dataset displays as expected. For example, try Alignment->{Center,Center}.

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