Not really - because the structural design of the cargo rack, its integration into the ship's structure and the effects of ship acceleration on the cargo racks and cargo need to be taken into consideration if the ship isn't going to rip itself apart....
As to cargo density, and using current gen containers as an example, the maximum permissible gross mass of a 20' TEU is 24,000kg while its internal volume is c.33.2m³ - so the structure that holds the container is designed to its permissible gross mass so as not to lose containers or worse at sea (too often, noting that some container ships do lose containers in very bad weather) while the average density of the container's contents cannot exceed 651kg/m³ (less than that of water), allowing for a tare weight of 2,400kg for the container itself. While a 20' TEU could be filled with gold it would likely rip itself apart if lifted or transported as the cargo mass of over 640,000kg would exceed the design limit by c.26x.