Q:

Exporting a table in .png format

I am trying to export a data table in PNG format. I evaluated 
Ptr = {{1, 5, 10, 20, 30}};

Ttr = {{300, 300, 300, 300, 300}};

P = {{382, 390, 400, 420, 440}};

T = {{}};
m = Join[Transpose[Ttr], Transpose[Ptr], Transpose[P], Transpose[T], 2];
firstRow = {{"", "Ttr(K)", "Ptr(kPa)", "P(kPa)", "T(K)"}};
mainRows = Join[Transpose[{{"n=11", "n=12", "n=13", "n=14", "n=15"}}], m, 2];

t = Join[firstRow, mainRows];
grid = 
  Text @
    Grid[t, 
      Dividers -> {2 -> True, 2 ->  True}, 
      ItemStyle -> {Bold, Red},
      Spacings -> {2, 1}];

 SetDirectory[NotebookDirectory[]];
 Export["grid.PNG", grid,  ImageResolution -> 400, 
 Background -> None];

Unfortunately, I get the image shown below in which the top side and left side are not so well exported!

I tried to solve this problem with Spacing. But it didn't work. In addition, when I exported the table as a PDF file, it worked, but I wish the image in PNG format or JPG format.

A:

May be this helps:
grid = Rasterize[
   Text@Grid[t, Dividers -> {2 -> True, 2 -> True}, 
     ItemStyle -> {Bold, Red}, Spacings -> {2, 1}], RasterSize -> 300];

SetDirectory[NotebookDirectory[]];
Export["grid.PNG", grid, ImageSize -> 800];

