How to make table with row name and column name
You should revise your table structure. 
You are trying to put too many different things into one table. 

What you could do is have multiple tables like so:

Table: site
Has an ID and all other details about the site! 
Table: Devices
Has an ID and all other details about the device. 
Table: measurements 
Has an ID and all other details about the measurement.

Now depending on if your measurements are linked to a single device or not you may need an intersection table or a device ID on the measurement,  and the same goes for the site. 

When you wish to select all the details about a site,  you will need to use joins to get everything,  or maybe multiple queries.