Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

The usual quick-and-dirty workaround when ItemSize does not do what is expected is to wrap contents into an invisible frame. One can use Framed with FrameStyle->None to hide the frame or Pane. In both cases, a magic number is required to convert between line-height of Grid and printers points of Framed/Pane - it is highly platform-specific (see herehere). The simplified example with Pane:

dot = Graphics[{Pink, Disk[]}, ImageSize -> 40];

magic = 10;

tab = {
   {"Type", "Name", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Esculap", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], "Dia.", 
    "Spec", \[SpanFromLeft], \[SpanFromAbove], 8.3 "mm", 
    Pane[11, {Automatic, 2.7*magic}, Alignment -> Center], "6.3"},
   {dot, "Flycatcher", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Apus", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], 6.9 "mm", 17, "9.8", \[SpanFromAbove], 7.8 "mm",
     Item[8, ItemSize -> {Automatic, 2.7}], "6.7"}
   };

Grid[tab, Spacings -> {Automatic, {{0, -1.1}}}, 
 Alignment -> {Center, Center}, Dividers -> All]

Mathematica graphics

One can get rid of the overhang (gap with missing dividers) by wrapping Item around the cell:

Item[Pane[11, {Automatic, 2.7*magic}, Alignment -> Center]]

Mathematica graphics

This issue of gaps is only present in version 8. My guess is that as ContentPadding -> True was added to Pane in version 8 only, in version 7 a different behaviour is the default for padding inside Pane that does not introduce these gaps. However, calling the above example with ContentPadding -> False in v8 does not remove the gaps contradily to my expectations.

An almost identical result can be obtained if given cell is wrapped in Framed (note the horizontal increase in size of the cell):

Framed[11, ImageSize -> {Automatic, 2.7*magic}, FrameStyle -> None]

Mathematica graphics

The usual quick-and-dirty workaround when ItemSize does not do what is expected is to wrap contents into an invisible frame. One can use Framed with FrameStyle->None to hide the frame or Pane. In both cases, a magic number is required to convert between line-height of Grid and printers points of Framed/Pane - it is highly platform-specific (see here). The simplified example with Pane:

dot = Graphics[{Pink, Disk[]}, ImageSize -> 40];

magic = 10;

tab = {
   {"Type", "Name", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Esculap", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], "Dia.", 
    "Spec", \[SpanFromLeft], \[SpanFromAbove], 8.3 "mm", 
    Pane[11, {Automatic, 2.7*magic}, Alignment -> Center], "6.3"},
   {dot, "Flycatcher", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Apus", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], 6.9 "mm", 17, "9.8", \[SpanFromAbove], 7.8 "mm",
     Item[8, ItemSize -> {Automatic, 2.7}], "6.7"}
   };

Grid[tab, Spacings -> {Automatic, {{0, -1.1}}}, 
 Alignment -> {Center, Center}, Dividers -> All]

Mathematica graphics

One can get rid of the overhang (gap with missing dividers) by wrapping Item around the cell:

Item[Pane[11, {Automatic, 2.7*magic}, Alignment -> Center]]

Mathematica graphics

This issue of gaps is only present in version 8. My guess is that as ContentPadding -> True was added to Pane in version 8 only, in version 7 a different behaviour is the default for padding inside Pane that does not introduce these gaps. However, calling the above example with ContentPadding -> False in v8 does not remove the gaps contradily to my expectations.

An almost identical result can be obtained if given cell is wrapped in Framed (note the horizontal increase in size of the cell):

Framed[11, ImageSize -> {Automatic, 2.7*magic}, FrameStyle -> None]

Mathematica graphics

The usual quick-and-dirty workaround when ItemSize does not do what is expected is to wrap contents into an invisible frame. One can use Framed with FrameStyle->None to hide the frame or Pane. In both cases, a magic number is required to convert between line-height of Grid and printers points of Framed/Pane - it is highly platform-specific (see here). The simplified example with Pane:

dot = Graphics[{Pink, Disk[]}, ImageSize -> 40];

magic = 10;

tab = {
   {"Type", "Name", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Esculap", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], "Dia.", 
    "Spec", \[SpanFromLeft], \[SpanFromAbove], 8.3 "mm", 
    Pane[11, {Automatic, 2.7*magic}, Alignment -> Center], "6.3"},
   {dot, "Flycatcher", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Apus", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], 6.9 "mm", 17, "9.8", \[SpanFromAbove], 7.8 "mm",
     Item[8, ItemSize -> {Automatic, 2.7}], "6.7"}
   };

Grid[tab, Spacings -> {Automatic, {{0, -1.1}}}, 
 Alignment -> {Center, Center}, Dividers -> All]

Mathematica graphics

One can get rid of the overhang (gap with missing dividers) by wrapping Item around the cell:

Item[Pane[11, {Automatic, 2.7*magic}, Alignment -> Center]]

Mathematica graphics

This issue of gaps is only present in version 8. My guess is that as ContentPadding -> True was added to Pane in version 8 only, in version 7 a different behaviour is the default for padding inside Pane that does not introduce these gaps. However, calling the above example with ContentPadding -> False in v8 does not remove the gaps contradily to my expectations.

An almost identical result can be obtained if given cell is wrapped in Framed (note the horizontal increase in size of the cell):

Framed[11, ImageSize -> {Automatic, 2.7*magic}, FrameStyle -> None]

Mathematica graphics

added 141 characters in body
Source Link
István Zachar
  • 47.2k
  • 20
  • 145
  • 293

The usual quick-and-dirty workaround when ItemSize does not do what is expected is to wrap contents into an invisible frame. One can use Framed with FrameStyle->None to hide the frame or Pane. In both cases, a magic number is required to convert between line-height of Grid and printers points of Framed/Pane - it is highly platform-specific (see here). The simplified example with Pane:

dot = Graphics[{Pink, Disk[]}, ImageSize -> 40];

magic = 10;

tab = {
   {"Type", "Name", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Esculap", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], "Dia.", 
    "Spec", \[SpanFromLeft], \[SpanFromAbove], 8.3 "mm", 
    Pane[11, {Automatic, 2.7*magic}, Alignment -> Center], "6.3"},
   {dot, "Flycatcher", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Apus", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], 6.9 "mm", 17, "9.8", \[SpanFromAbove], 7.8 "mm",
     Item[8, ItemSize -> {Automatic, 2.7}], "6.7"}
   };

Grid[tab, Spacings -> {Automatic, {{0, -1.1}}}, 
 Alignment -> {Center, Center}, Dividers -> All]

Mathematica graphics

One can get rid of the overhang (missinggap with missing dividers, at least in version 8) by wrapping Item around the cell:

Item[Pane[11, {Automatic, 2.7*magic}, Alignment -> Center]]

Mathematica graphics

This issue of gaps is only present in version 8. My guess is that as ContentPadding -> True was added to Pane in version 8 only, in version 7 a different behaviour is the default for padding inside Pane that does not introduce these gaps. However, calling the above example with ContentPadding -> False in v8 does not remove the gaps contradily to my expectations.

An almost identical result can be obtained if given cell is wrapped in Framed (note the horizontal increase in size of the cell):

Framed[11, ImageSize -> {Automatic, 2.7*magic}, FrameStyle -> None]

Mathematica graphics

The usual quick-and-dirty workaround when ItemSize does not do what is expected is to wrap contents into an invisible frame. One can use Framed with FrameStyle->None to hide the frame or Pane. In both cases, a magic number is required to convert between line-height of Grid and printers points of Framed/Pane - it is highly platform-specific (see here). The simplified example with Pane:

dot = Graphics[{Pink, Disk[]}, ImageSize -> 40];

magic = 10;

tab = {
   {"Type", "Name", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Esculap", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], "Dia.", 
    "Spec", \[SpanFromLeft], \[SpanFromAbove], 8.3 "mm", 
    Pane[11, {Automatic, 2.7*magic}, Alignment -> Center], "6.3"},
   {dot, "Flycatcher", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Apus", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], 6.9 "mm", 17, "9.8", \[SpanFromAbove], 7.8 "mm",
     Item[8, ItemSize -> {Automatic, 2.7}], "6.7"}
   };

Grid[tab, Spacings -> {Automatic, {{0, -1.1}}}, 
 Alignment -> {Center, Center}, Dividers -> All]

Mathematica graphics

One can get rid of the overhang (missing dividers, at least in version 8) by wrapping Item around the cell:

Item[Pane[11, {Automatic, 2.7*magic}, Alignment -> Center]]

Mathematica graphics

An almost identical result can be obtained if given cell is wrapped in Framed (note the horizontal increase in size of the cell):

Framed[11, ImageSize -> {Automatic, 2.7*magic}, FrameStyle -> None]

Mathematica graphics

The usual quick-and-dirty workaround when ItemSize does not do what is expected is to wrap contents into an invisible frame. One can use Framed with FrameStyle->None to hide the frame or Pane. In both cases, a magic number is required to convert between line-height of Grid and printers points of Framed/Pane - it is highly platform-specific (see here). The simplified example with Pane:

dot = Graphics[{Pink, Disk[]}, ImageSize -> 40];

magic = 10;

tab = {
   {"Type", "Name", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Esculap", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], "Dia.", 
    "Spec", \[SpanFromLeft], \[SpanFromAbove], 8.3 "mm", 
    Pane[11, {Automatic, 2.7*magic}, Alignment -> Center], "6.3"},
   {dot, "Flycatcher", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Apus", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], 6.9 "mm", 17, "9.8", \[SpanFromAbove], 7.8 "mm",
     Item[8, ItemSize -> {Automatic, 2.7}], "6.7"}
   };

Grid[tab, Spacings -> {Automatic, {{0, -1.1}}}, 
 Alignment -> {Center, Center}, Dividers -> All]

Mathematica graphics

One can get rid of the overhang (gap with missing dividers) by wrapping Item around the cell:

Item[Pane[11, {Automatic, 2.7*magic}, Alignment -> Center]]

Mathematica graphics

This issue of gaps is only present in version 8. My guess is that as ContentPadding -> True was added to Pane in version 8 only, in version 7 a different behaviour is the default for padding inside Pane that does not introduce these gaps. However, calling the above example with ContentPadding -> False in v8 does not remove the gaps contradily to my expectations.

An almost identical result can be obtained if given cell is wrapped in Framed (note the horizontal increase in size of the cell):

Framed[11, ImageSize -> {Automatic, 2.7*magic}, FrameStyle -> None]

Mathematica graphics

added 141 characters in body
Source Link
István Zachar
  • 47.2k
  • 20
  • 145
  • 293

The usual quick-and-dirty workaround when ItemSize does not do what is expected is to wrap contents into an invisible frame. One can use Framed with FrameStyle->None to hide the frame or Pane. In both cases, a magic number is required to convert between line-height of Grid and printers points of Framed/Pane - it is highly platform-specific (see here). The simplified example with Pane:

dot = Graphics[{Pink, Disk[]}, ImageSize -> 40];

magic = 10;

tab = {
   {"Type", "Name", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Esculap", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], "Dia.", 
    "Spec", \[SpanFromLeft], \[SpanFromAbove], 8.3 "mm", 
    Pane[11, {Automatic, 2.7*magic}, Alignment -> Center], "6.3"},
   {dot, "Flycatcher", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Apus", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], 6.9 "mm", 17, "9.8", \[SpanFromAbove], 7.8 "mm",
     Item[8, ItemSize -> {Automatic, 2.7}], "6.7"}
   };

Grid[tab, Spacings -> {Automatic, {{0, -1.1}}}, 
 Alignment -> {Center, Center}, Dividers -> All]

An almost identical resultMathematica graphics

One can be obtained if given cell is wrappedget rid of the overhang (missing dividers, at least in version 8) by wrapping FramedItem around the cell:

Framed[11Item[Pane[11, ImageSize -> {Automatic, 2.7*magic}, FrameStyleAlignment -> None]Center]]

Mathematica graphicsMathematica graphics

OneAn almost identical result can get rid of the overhang (missing dividers) by wrappingbe obtained if given cell is wrapped in ItemFramed around(note the horizontal increase in size of the cell):

Item[Pane[11Framed[11, ImageSize -> {Automatic, 2.7*magic}, AlignmentFrameStyle -> Center]]None]

Mathematica graphicsMathematica graphics

The usual quick-and-dirty workaround when ItemSize does not do what is expected is to wrap contents into an invisible frame. One can use Framed with FrameStyle->None to hide the frame or Pane. In both cases, a magic number is required to convert between line-height of Grid and printers points of Framed/Pane - it is highly platform-specific (see here). The simplified example with Pane:

dot = Graphics[{Pink, Disk[]}, ImageSize -> 40];

magic = 10;

tab = {
   {"Type", "Name", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Esculap", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], "Dia.", 
    "Spec", \[SpanFromLeft], \[SpanFromAbove], 8.3 "mm", 
    Pane[11, {Automatic, 2.7*magic}, Alignment -> Center], "6.3"},
   {dot, "Flycatcher", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Apus", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], 6.9 "mm", 17, "9.8", \[SpanFromAbove], 7.8 "mm",
     Item[8, ItemSize -> {Automatic, 2.7}], "6.7"}
   };

Grid[tab, Spacings -> {Automatic, {{0, -1.1}}}, 
 Alignment -> {Center, Center}, Dividers -> All]

An almost identical result can be obtained if given cell is wrapped in Framed:

Framed[11, ImageSize -> {Automatic, 2.7*magic}, FrameStyle -> None]

Mathematica graphics

One can get rid of the overhang (missing dividers) by wrapping Item around the cell:

Item[Pane[11, {Automatic, 2.7*magic}, Alignment -> Center]]

Mathematica graphics

The usual quick-and-dirty workaround when ItemSize does not do what is expected is to wrap contents into an invisible frame. One can use Framed with FrameStyle->None to hide the frame or Pane. In both cases, a magic number is required to convert between line-height of Grid and printers points of Framed/Pane - it is highly platform-specific (see here). The simplified example with Pane:

dot = Graphics[{Pink, Disk[]}, ImageSize -> 40];

magic = 10;

tab = {
   {"Type", "Name", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Esculap", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], "Dia.", 
    "Spec", \[SpanFromLeft], \[SpanFromAbove], 8.3 "mm", 
    Pane[11, {Automatic, 2.7*magic}, Alignment -> Center], "6.3"},
   {dot, "Flycatcher", \[SpanFromLeft], \[SpanFromLeft], dot, 
    "Apus", \[SpanFromLeft], \[SpanFromLeft]},
   {\[SpanFromAbove], 6.9 "mm", 17, "9.8", \[SpanFromAbove], 7.8 "mm",
     Item[8, ItemSize -> {Automatic, 2.7}], "6.7"}
   };

Grid[tab, Spacings -> {Automatic, {{0, -1.1}}}, 
 Alignment -> {Center, Center}, Dividers -> All]

Mathematica graphics

One can get rid of the overhang (missing dividers, at least in version 8) by wrapping Item around the cell:

Item[Pane[11, {Automatic, 2.7*magic}, Alignment -> Center]]

Mathematica graphics

An almost identical result can be obtained if given cell is wrapped in Framed (note the horizontal increase in size of the cell):

Framed[11, ImageSize -> {Automatic, 2.7*magic}, FrameStyle -> None]

Mathematica graphics

added 137 characters in body
Source Link
István Zachar
  • 47.2k
  • 20
  • 145
  • 293
Loading
added 137 characters in body
Source Link
István Zachar
  • 47.2k
  • 20
  • 145
  • 293
Loading
Source Link
István Zachar
  • 47.2k
  • 20
  • 145
  • 293
Loading