title: how to create a table with javascript?
body: <p>I have this php function, which I want to convert to javascript function, but I don't know how to create a table in javascript.</p>
  
  <p>I guess I have to have a container (DIV) to insert the table into with javascript.</p>
  
  <p>Here is the php function simplified: (it counts height and width and repeats a 1px shadow to create a drop-shadow effect)</p>
  
  <pre><code>function drpShadow($pic_url){
  
      $pic_display="&lt;table border='0' style='display:inline;' cellspacing='0' cellpadding='0'&gt;&lt;tr&gt;&lt;td width='4px' height='$height'&gt;&lt;img src='/SV/Graphics/drop_shadow_top_left_corner_4x4.jpg'&gt;&lt;br&gt;";
      for ($i=0; $i&lt;($height-4); $i++){
          $pic_display.="&lt;img src='/SV/Graphics/drop_shadow_left_4x1.jpg'&gt;&lt;br&gt;";
      }
      $pic_display.="&lt;/td&gt;&lt;td width='$width' height='$height'&gt;&lt;img src='../temp_images/$pic_url'&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' height='4px' width='($width+4)'&gt;&lt;img src='/SV/Graphics/drop_shadow_left_bottom_corner_4x4.jpg'&gt;";
      for ($i=0; $i&lt;=($width-6); $i++){
          $pic_display.="&lt;img src='/SV/Graphics/drop_shadow_bottom_1x4.jpg'&gt;";
      }
      $pic_display.="&lt;img src='/SV/Graphics/drop_shadow_right_bottom_corner_4x4.jpg'&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;";
      return $pic_display;
  }
  </code></pre>
  
  <p>Please guide me, or even better, give me some code :)</p>
  
  <p>Thanks</p>