Why can't light pass certain materials but Magnetic and Electric fields can If I shine some light on a wooden table it doesn't pass through. 
However, if I attach two magnets one above and the other one below the table they still experience a force that attracts or repels them. Analogously for the electric field. 
Since light is an electromagnetic wave why doesn't it behave like an electric or magnetic field when it comes to passing through certain objects?
 A: Consider that electric and magnetic fields can't pass through everything either. The magnet in an old disk hard drive does not pass through "mu-metal", a type of alloy that is good at redirecting magnetic fields. Superconductors are even better, they can repel out magnetic fields so well that they can levitate (many YouTube videos on this topic!).
Electric fields don't really pass through Faraday cages either, something that is important for shielding electrical components.
The key quantity is the relative dielectric permittivity $\epsilon(\omega)$ and magnetic permeability $\mu(\omega)$. Here $\omega$ is the frequency of the electromagnetic field.
But you have touched on one important thing, that most metals don't block static magnetic fields as efficiently as they block electric fields. 
To block an electric field, all you need to do is to move charge around and keep it there. This is very easy for meals because charge can move on demand. But for magnetic fields things are different. Essentially this is because you have two options for blocking a magnetic field: (1) run a circulating current to block the field or (2) use the spins of all your electrons as an ensemble of repelling magnets. The first is hard because most metals have non-zero resistance,  except for superconductors. This means the circulating current doesn't last very long, it dies off and turns into heat. Mu-metal and high permeability alloys work based of off the second option, but most materials don't have electron spins that are amenable to doing this (e.g., wood, glass,  aluminum all pretty much fail at this).
But wait a minute, doesn't light have a changing magnetic field, why doesn't the above logic work for that too? The key point here is that the magnetic field of light is changing, so you don't need permanent currents, just temporary ones, and this gets around the issue of resistance causing currents to die out.
You can see this effect if you try to apply a changing magnetic field onto a metal like copper. Even though a constant magnetic field will pass through copper easily, a changing magnetic field will cause a counteracting current that initially blocks the field (plenty of YouTube videos about this effect).
