HTML code of table with various row and column size
<p><img src="https://i.stack.imgur.com/B2dPr.png" alt="table"></p>

<p>It seems easy but can't write the HTML code of the above table.<br>
Here is what I tried so far:</p>

<pre><code>  &lt;table border="1" style="border-collapse:collapse;" width="25%"&gt;
    &lt;tr&gt;
      &lt;td&gt;col1&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;2&lt;/td&gt;
      &lt;td&gt;3&lt;/td&gt;
      &lt;td&gt;4&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
</code></pre>