How to give border to table through javascript? : i want  to give border to my table through javascript so when i am using 

    var table=document.createElement("table").style.border="1px solid";
and try to append the row to this table like this 

     table.appendChild(newRow);
above line throwing exception as follows:


    Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.

and if i try to execute the same code without giving border it executes properly
please help me with this. 

 