I want the the table to be displayed in pdf format .
we are using
format.html format.json{render json: @user}
et
Another thing is Prawn.
It seems more robust and support complex situations. So you may choose this to work with something sophisticated. Get the http://prawn.majesticseacreature.com/manual.pdf here.