# Creating a drop shadow table

I'm working with a consumer math class on wages and earnings, and came across the table below.

As a learning exercise, and to create future tables where I can easily modify the information, I thought I would tackle this in Mathematica.

I played a bit with the grid constructs, SpanFromLeft, SpanFromAbove, etc. but I think I need a better overview before I even begin.

empname = Item[Row[{Style["Employee Name:", Bold], "\tJolie"}]];

companyA = Item[Style["Company:", Bold]];

companyB = Item["ABC Elevator Repair"];

paybegin = Item[Row[{Style["Pay Begin Date:", Bold], "\t10/13/2010"}]];

payend = Item[Row[{Style["Pay End Date:", Bold], "\t10/19/2010"}]];

Grid[{{empname, SpanFromLeft}, {companyA, paybegin}, {companyB,
payend}}, Alignment -> Left, Frame -> All]


Should I treat this as three tables, and use Column to pull them together?

Could I use the Torn Image approach to get the drop shadow?

I know this is a big question, looking for any comments from others who may have tried to create something similar, or direction to simply use another tool for this kind of job!

Here is some edited code, using the shadow package and some Frame constructs, should be possible to make this look pretty close.

empname = Item[Row[{Style["Employee Name:", Bold], "\tJolie"}]];
companyA =
Item[Style["Company:", Bold], Frame -> {False, True, True, True}];
companyB =
Item["ABC Elevator Repair", Frame -> {True, True, False, True}];
paybegin =
Item[Row[{Style["Pay Begin Date:", Bold], "\t10/13/2010"}],
Frame -> True];
payend = Item[Row[{Style["Pay End Date:", Bold], "\t10/19/2010"}],
Frame -> True];
Grid[{{empname, SpanFromLeft}, {companyA, paybegin}, {companyB,
payend}},
Alignment -> Left,
Frame -> True]

• Best to post some of the code you have tried. Dec 26, 2016 at 23:57

## 2 Answers

Simon Woods wrote an awesome package for drop shadows. It's called shadow.

Let table be the table in your question, then

shadow[table, 0, 10]


If we want the shredded paper effect in Sumit's answer, we can do

shadow[table, {"TBLR", 0.2}, 10, "outline" -> True]


As for your other question, yes, I would make those three separate tables and pull them together using Column. I would then apply shadow to the Column.

• This is super helpful. I can almost see my way to the finished table. How do I customize the dividers (I.E. I don't want the line under company)? Dec 27, 2016 at 14:29
• @TomDeVries You'd use Frame -> {False, True, True, True} on the Item in companyA. Dec 27, 2016 at 14:38

You can use Torn Image approach

g = Grid[{{empname, SpanFromLeft}, {companyA, paybegin}, {companyB,
payend}}, Alignment -> Left, Frame -> All]
img = Image@Rasterize[g]
torn[img, {{0, 1}, {1, 0}}, "offset" -> {20, 20}, "gaussianBlur" -> 10]


Probably it would be a better option to create a blurred frame and use Inset for the text part.

(Related post - How can I make a 2D line plot with a drop shadow under the line?)