PHP, 196 Bytes
==============

    for(;a&$k="01112344453"[$i++];print"$l\n")for($l="",$b="+||"[$k%3],$n=0;$n++<$a=$argn;)$l.=$i<6&$n%2&$n!=$a||$i>5&$n%2<1||$i>5&$n==$a?($l?"":"$b").["----+","    |",sprintf(" %02d |",$n)][$k%3]:"";

[Try it online!](https://tio.run/nexus/php#PU5LCoMwFNz3FHZ4iiFW/LZgknoQ60IptkFJxXaZu9toobMYmA/znqzn53ygbnkYdRHr8FpC0QU0KiRpmmZ5URRljoY0562YF20@oOlmwLYmTQqIqFfg1rrS6OdtREYlggznkjq1DwtGU6xIy3NAxs8cHV1gLelruTsy/QvlktoN10AF6sHiBicHjgieg0X03t8YQnh@kt03hwxrf9crQKzrFw "PHP – TIO Nexus")

PHP, 235 Bytes
==============

    for(;$i++<$a=$argn;)$r[$i==$a|1-$i&1][]=($p=str_pad)($i,2,0,0);for(;$j<6;)$l[]=($a<2&$j<3?"":[$p("+",$c=($j<3?floor:ceil)($a/2)*5+1,"----+"),$p("|",$c,"    |"),"| ".join(" | ",$r[$j/3])." |"])[$j++%3]."\n";echo strtr("01112344453",$l);

Case 1 with optional newlines

[Try it online!](https://tio.run/nexus/php#JY7NjsMgDITvfYrI8lZQaBpC2pVKUB8kiyqU/hFFAbE95t2zTtcnz@cZa9pLeqUN@vyc7LdZHjEzg0GIFr39UMMxdxgsqVntMWyV65xlmOzvO1@Tv3GGQdaykhU3//GhPVFq/Nh8W28J6AvAucPEQIDEng4re4wx5nN/DyM98Yea745CSdjTCOBytc@rXUJBMxOCuYByiGFiUNAq127DQTtekgbHSQnxpV0JPxOYe/@KBdV8ZwaVUqrWTdMcNcVGbpblDw "PHP – TIO Nexus")

Expanded

    for(;$i++<$a=$argn;)
      $r[$i==$a|1-$i&1][]=($p=str_pad)($i,2,0,0); # make an 2D array 0:odd values 1:even values and last value  
    for(;$j<6;) # create 6 strings for each different line
      $l[]=($a<2&$j<3 # if last value =1 and line number under 3 
        ?"" # make an empty string empty [] as alternative
        :[$p("+",$c=($j<3 # else make the 0 or 3 line and store the count for next line
          ?floor # if line number =0 count=floor ($a/2)  multiply 5 and add 1
          :ceil)($a/2)*5+1,"----+") # else count= ceil($a/2) multiply 5 and add 1
        ,$p("|",$c,"    |") # make lines 1 and 4
        ,"| ".join(" | ",$r[$j/3])." |"])[$j++%3]."\n"; #make lines 2 odd values and 5 even values and last value
    echo strtr("01112344453",$l); # Output after replace the digits with the 6 strings

PHP, 300 Bytes
==============

    for(;$i++<$a=$argn;)$r[$i==$a||!($i%2)][]=($p=str_pad)($i,2,0,0);echo strtr("01112344453",($a>1?[$p("+",$c=($a/2^0)*5+1,"----+")."\n",$p("|",$c,"    |")."\n","| ".join(" | ",$r[0])." |\n"]:["","",""])+[3=>$p("+",$c=ceil($a/2)*5+1,"----+")."\n",$p("|",$c,"    |")."\n","| ".join(" | ",$r[1])." |\n"]);

replace `["","",""]` with `["\n","\n","\n"]` if you want newlines for case `1`

[Try it online!](https://tio.run/nexus/php#pY5NbgIxDIX3PUVquVJCAk3mZ0MIHCRNq2iYliA0E6Usc/epQUIcoJYX9ntP/rw75FN@wVh@Jmd6u3zPhVtMUu4wurtsBRaPydFW6yvH9NaI4IPjmN3vtXzleBSkqkZppYUdh9PMSL8WDtoY07Rd1/UtKI5xbw4eMwcJCgc6EN@bTy1WvTQK1lQSxAY@JnIpVG8hBYyqPnSoDDbnOU0cGI2KPtOBPFbJDVsPFLl1ENK3bv9kDWO63Hn/pJknTdhl@QM "PHP – TIO Nexus")