text:
Print the Periodic Table
Your challenge is to print/output/return this text:
 _____                                                                                _____
|  1  |                                                                                |  2  |
|  H  |                                                                                |  He |
|_____|_____                                                             _____________________________|_____|
|  3  |  4  |                                                           |  5  |  6  |  7  |  8  |  9  |  10 |
|  Li |  Be |                                                           |  B  |  C  |  N  |  O  |  F  |  Ne |
|_____|_____|                                                           |_____|_____|_____|_____|_____|_____|
|  11 |  12 |                                                           |  13 |  14 |  15 |  16 |  17 |  18 |
|  Na |  Mg |                                                           |  Al |  Si |  P  |  S  |  Cl |  Ar |
|_____|_____|___________________________________________________________|_____|_____|_____|_____|_____|_____|
|  19 |  20 |  21 |  22 |  23 |  24 |  25 |  26 |  27 |  28 |  29 |  30 |  31 |  32 |  33 |  34 |  35 |  36 |
|  K  |  Ca |  Sc |  Ti |  V  |  Cr |  Mn |  Fe |  Co |  Ni |  Cu |  Zn |  Ga |  Ge |  As |  Se |  Br |  Kr |
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
|  37 |  38 |  39 |  40 |  41 |  42 |  43 |  44 |  45 |  46 |  47 |  48 |  49 |  50 |  51 |  52 |  53 |  54 |
|  Rb |  Sr |  Y  |  Zr |  Nb |  Mo |  Tc |  Ru |  Rh |  Pd |  Ag |  Cd |  In |  Sn |  Sb |  Te |  I  |  Xe |
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
|  55 |  56 |  57 \  72 |  73 |  74 |  75 |  76 |  77 |  78 |  79 |  80 |  81 |  82 |  83 |  84 |  85 |  86 |
|  Cs |  Ba |  La /  Hf |  Ta |  W  |  Re |  Os |  Ir |  Pt |  Au |  Hg |  Tl |  Pb |  Bi |  Po |  At |  Rn |
|_____|_____|_____\_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
|  87 |  88 |  89 / 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 |
|  Fr |  Ra |  Ac \  Rf |  Db |  Sg |  Bh |  Hs |  Mt |  Ds |  Rg |  Cn |  Nh |  Fl |  Mc |  Lv |  Ts |  Og |
|_____|_____|_____/_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|

                  ____________________________________________________________________________________
                  \  58 |  59 |  60 |  61 |  62 |  63 |  64 |  65 |  66 |  67 |  68 |  69 |  70 |  71 \
                  /  Ce |  Pr |  Nd |  Pm |  Sm |  Eu |  Gd |  Tb |  Dy |  Ho |  Er |  Tm |  Yb |  Lu /
                  \_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____\
                  /  90 |  91 |  92 |  93 |  94 |  95 |  96 |  97 |  98 |  99 | 100 | 101 | 102 | 103 /
                  \  Th |  Pa |  U  |  Np |  Pu |  Am |  Cm |  Bk |  Cf |  Es |  Fm |  Md |  No |  Lr \
                  /_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____/

Rules:

The empty line count between the two parts can be any amount (including 0)
Each line can have prepending and appending spaces as long as the two parts look correctly and the second part is indented at least one space more than the first one.
You may have appending/prepending newlines and/or spaces.
You may not use tabs for spacing (as long as there isn't an interpreter which replaces them correctly with spaces).
Because of a mistake of mine, you can choose to use                       ______ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____  as the 1st line of the second part.

Data:
you can use this text as a reference (but not as input):
Contents: symbol, atomic number, group, period
groups 8 & 9 and periods 4-17 are used for the second part.
H 1 1 1
He 2 18 1
Li 3 1 2
Be 4 2 2
B 5 13 2
C 6 14 2
N 7 15 2
O 8 16 2
F 9 17 2
Ne 10 18 2
Na 11 1 3
Mg 12 2 3
Al 13 13 3
Si 14 14 3
P 15 15 3
S 16 16 3
Cl 17 17 3
Ar 18 18 3
K 19 1 4
Ca 20 2 4
Sc 21 3 4
Ti 22 4 4
V 23 5 4
Cr 24 6 4
Mn 25 7 4
Fe 26 8 4
Co 27 9 4
Ni 28 10 4
Cu 29 11 4
Zn 30 12 4
Ga 31 13 4
Ge 32 14 4
As 33 15 4
Se 34 16 4
Br 35 17 4
Kr 36 18 4
Rb 37 1 5
Sr 38 2 5
Y 39 3 5
Zr 40 4 5
Nb 41 5 5
Mo 42 6 5
Tc 43 7 5
Ru 44 8 5
Rh 45 9 5
Pd 46 10 5
Ag 47 11 5
Cd 48 12 5
In 49 13 5
Sn 50 14 5
Sb 51 15 5
Te 52 16 5
I 53 17 5
Xe 54 18 5
Cs 55 1 6
Ba 56 2 6
La 57 3 6
Hf 72 4 6
Ta 73 5 6
W 74 6 6
Re 75 7 6
Os 76 8 6
Ir 77 9 6
Pt 78 10 6
Au 79 11 6
Hg 80 12 6
Tl 81 13 6
Pb 82 14 6
Bi 83 15 6
Po 84 16 6
At 85 17 6
Rn 86 18 6
Fr 87 1 7
Ra 88 2 7
Ac 89 3 7
Rf 104 4 7
Db 105 5 7
Sg 106 6 7
Bh 107 7 7
Hs 108 8 7
Mt 109 9 7
Ds 110 10 7
Rg 111 11 7
Cn 112 12 7
Nh 113 13 7
Fl 114 14 7
Mc 115 15 7
Lv 116 16 7
Ts 117 17 7
Og 118 18 7
Ce 58 4 8
Pr 59 5 8
Nd 60 6 8
Pm 61 7 8
Sm 62 8 8
Eu 63 9 8
Gd 64 10 8
Tb 65 11 8
Dy 66 12 8
Ho 67 13 8
Er 68 14 8
Tm 69 15 8
Yb 70 16 8
Lu 71 17 8
Th 90 4 9
Pa 91 5 9
U 92 6 9
Np 93 7 9
Pu 94 8 9
Am 95 9 9
Cm 96 10 9
Bk 97 11 9
Cf 98 12 9
Es 99 13 9
Fm 100 14 9
Md 101 15 9
No 102 16 9
Lr 103 17 9

Built-ins that give any info about the periodic table of elements are allowed but should be viewed separately from non-built-in solutions.
The shortest code per language wins!

Is it okay to invert the slashes (all of them)? Is it okay to make the cells bigger or smaller?

@JanDvorak I'd say no as it changes the shape of the bottom portions joining

@dzaima I'd change those slashes as well, of course

@JanDvorak All that you can change is what's specified in the post.

I was expecting a challenge to generate the electron shells of the known elements :)

@JollyJoker I was thinking to make that an another challenge after this!

The upper border of the lantanidies features a few whitespaces in between, while the upper borders in the main table doesn't. Is this intentional?

@dzaima I think that allowing both is the best option since that was a mistake.

@dzaima Can we use the power of THE INTERNET?

@Feathercrown pretty sure that counts as this standard loophole

@dzaima thought so :P

@JollyJoker http://codegolf.stackexchange.com/questions/62030/electron-configuration-diagrams

Working on a 400-ish byte answer that may blow everything out of the water... incoming in 10 days lol.

THOSE SLASHES ARE PURE EVIL. PURE EVIL I TELLS YA!

The newline count between the two parts can be any amount. Is zero allowed as they are still separated?

@l4m2 if you mean 0 empty lines (as 0 newlines would mean the two lines are on the same line (which should be mentioned in the spec..)), yes

You may not use tabs for spacing (as long as there isn't an interpreter which replaces them correctly with spaces). what if tabs before the second part so any amount of spaces was allowed

(if I interpreted your question correctly) no, tabs before the second part aren't allowed as tabs don't have a consistent defined width (besides, 1 space is enough so why bother with tabs?)

Related: https://codegolf.stackexchange.com/questions/248689/position-from-atomic-number-in-the-periodic-table

Bubblegum, 535 bytes
0000000: e0 0c 4a 02 0f 5d 00 10 17 f0 84 1b a9 df 70 5a  ..J..]........pZ
0000010: a9 c3 a0 9d ad 4f 8b 91 5d a2 33 5c b1 1d 4d 48  .....O..].3\..MH
0000020: 0d 80 c4 80 7f da b5 6f 8a 4a 45 20 34 51 d7 2c  .......o.JE 4Q.,
0000030: bc 47 4c ea c5 45 24 db a1 3d 46 42 e0 c8 51 ed  .GL..E$..=FB..Q.
0000040: b6 b8 2b fb 42 dd 7b 44 bc e2 bf a8 c8 80 be 8a  ..+.B.{D........
0000050: 30 2b e1 c7 39 c6 41 30 36 c6 c2 93 0b b2 ac 42  0+..9.A06......B
0000060: 06 5b bd b7 f9 40 11 9e 57 78 ff 0f 8a 45 f8 d7  .[...@..Wx...E..
0000070: b9 ea 6c 8a 6c e5 bf bb 9c f5 18 db 98 85 13 cc  ..l.l...........
0000080: d3 a8 38 9c 55 fe b2 f1 31 1d e0 0e 67 84 b6 48  ..8.U...1...g..H
0000090: 8e 68 2a 8a c6 99 0a 13 1b 10 f0 b5 e2 e0 43 02  .h*...........C.
00000a0: 6f 52 b0 3e d5 27 a9 eb a4 99 4e b2 c2 8b 51 49  oR.>.'....N...QI
00000b0: 9b 7e 46 99 22 31 4f 8c 70 6d 16 b4 a7 79 01 08  .~F."1O.pm...y..
00000c0: 42 01 a8 af 98 d1 38 d3 77 35 c9 3f fc f5 ae 88  B.....8.w5.?....
00000d0: 47 be 91 a0 ab ac ab b7 04 9a fc 81 60 92 61 a1  G...........`.a.
00000e0: 54 f9 92 46 2f bd 70 20 ba dc 29 63 35 29 c4 48  T..F/.p ..)c5).H
00000f0: be ee 7f 3d d6 8c 1e b9 f3 ab 17 23 0e 1d 86 2c  ...=.......#...,
0000100: d4 28 ce 4a 46 df 6e 3a c3 25 7d 3f 1b e4 3c 03  .(.JF.n:.%}?..<.
0000110: c9 1f 38 96 30 1e c9 6e de fa 26 8f a1 59 18 69  ..8.0..n..&..Y.i
0000120: 68 9a 35 c4 42 56 2a 6f b2 3b 3f b3 ae 60 96 a8  h.5.BV*o.;?..`..
0000130: 5d c4 9d 0d cc 0b d6 ec b9 58 28 d3 3c bb 0d f3  ]........X(.<...
0000140: b6 56 1d b2 f8 da 3b f1 3c 11 9e e7 56 c8 20 27  .V....;.<...V. '
0000150: 76 65 3e d9 1e 17 e5 d2 4f 65 8e 83 c2 27 5a bf  ve>.....Oe...'Z.
0000160: 1f 80 bf f4 4b 78 b0 0e 3f 1e 4d 96 63 b9 65 5a  ....Kx..?.M.c.eZ
0000170: 34 43 c8 9a a9 8e 62 5a cc af ab 10 ff 26 1f ae  4C....bZ.....&..
0000180: 03 ef 4c 8f ba 09 b8 1e 7a 1e bb 5d 77 d3 f8 06  ..L.....z..]w...
0000190: 71 53 67 60 26 91 28 81 2e 5e bc 84 9f 48 cc ce  qSg`&.(..^...H..
00001a0: 60 ec b4 b3 fa 27 32 60 27 98 63 a3 80 66 65 d2  `....'2`'.c..fe.
00001b0: ed 0b af e7 ba d1 d8 85 d3 af 93 7f a2 48 15 68  .............H.h
00001c0: a8 78 74 f8 ed 6f 6b 25 5f ca 7d 28 fb 0c 94 ce  .xt..ok%_.}(....
00001d0: 7a fc 6e b6 32 88 6a 62 b3 84 b8 98 d3 b9 01 73  z.n.2.jb.......s
00001e0: e4 76 07 3e 4e a0 15 82 1b 4a e1 89 13 75 4c ee  .v.>N....J...uL.
00001f0: 09 06 05 75 cc 0a 51 88 38 31 f6 7e e8 f8 74 b7  ...u..Q.81.~..t.
0000200: 59 9c e6 00 53 4f e7 80 ae 8c a5 85 55 e7 08 ae  Y...SO......U...
0000210: 84 69 18 84 dc c0 00                             .i.....

Uses LZMA compression.
Try it online!

Polite query; is using a language you invented yourself considered cheating?!  (Even if it's categorised under 'joke languages'?!)

@Grim No, it's not cheating since the language existed before the challenge. Many many many users use their own languages (including me).

Unfortunately, many many many users (including myself) don't have a clue what you code golfers are on about 99% of the time!  Still makes interesting reading though :D

@Grim IMO it's not considered cheating, why would someone create a programming language other than to use it?

To sell it. $$$!

@CalculatorFeline so that's what happens to the Try It Online donations...

JavaScript (ES6), 756 750 bytes

j=i=1
r=s=>s[0].replace(/.(\d+)/g,(s,n)=>s[0].repeat(n))
f=s=>[(s=s[0].match(/../g)).map(_=>(i>99?` `:`  `)+i+(i++>9?` `:`  `)),s.map(s=>`  ${s} `),s.map(_=>r`_5`)].map(a=>a.join`|`)
g=(a,b,c)=>a.map((s,i)=>s+b[i]+c[i])
document.write(r`<pre> _5 97_5
|`+[...g(f`H `,[s=r`| 95|`,s,r`|_5 61_29|`],f`He`),...g(f`LiBe`,[s=r`| 59|`,s,s],f`B C N O F Ne`),...g(f`NaMg`,[s,s,r`|_59|`],f`AlSiP S ClAr`),...f`K CaScTiV CrMnFeCoNiCuZnGaGeAsSeBrKr`,...f`RbSrY ZrNbMoTcRuRhPdAgCdInSnSbTeI Xe`,...g(f`CsBaLa`,(a=f`CePrNdPmSmEuGdTbDyHoErTmYbLu`,`\\/\\`),f`HfTaW ReOsIrPtAuHgTlPbBiPoAtRn`),...g(f`FrRaAc`,(a=[...a,...f`ThPaU NpPuAmCmBkCfEsFmMdNoLr`],`/\\/`),f`RfDbSgBhHsMtDsRgCnNhFlMcLvTsOg`)].join`|
|`+r`|

 18_84
 `+a.map(s=>r` 17`+`\\/`[j^=1]+s+`\\/`[j]).join`
 `)

Explanation:

a contains the (formatted) Lanthanides and Actinides
j is used to track which character is used to draw the zigzag of the Lanthanides and Actinides
i is simply the number of the next element to be formatted. Although it's not strictly necessary to format the elements in order, I think there's a small byte saving in doing so.
r is a run-length decoding function. It expects to be called using a template string parameter. Any number in the string causes the preceding character to be repeated that many times, e.g. r`_5` is the same as `_____` (but 2 bytes shorter of course). I did originally have a more sophisticated version that could handle r`${i<100} `+i+r`${i++<10} ` but it turned out to be shorter to keep that as a special case.
f is an element formatting function. It expects to be called using a template string parameter that contains the elements as pairs of characters (space padded out for single-character element names). An array of three strings is returned, one for the element numbers, one for the element names, and one for the underlines. If more than one element is formatted, they are joined with a | separator.
g is a glue function. It expects to be called with three arrays (the second and third parameters can be strings if only one character is needed) and returns a single array with all the corresponding strings concatenated together.

The first three rows of elements are handled by gluing the formatted elements from each side with an appropriate amount of space. The fourth and fifth rows need no glue. The sixth and seventh rows are handled by gluing the formatted elements from each side with the appropriate zigzag. The 21 rows are then joined together with | borders and newlines. Meanwhile the 6 rows of the Lanthanides and Actinides are given their padding and zigzag and joined together with newlines. Finally the pieces are concatenated with the necessary remaining formatting elements. Edit: Saved 6 bytes because I forgot to substitute literal newlines after developing the code.
If a full table with the Lanthanides and Actinides in situ is acceptable, then for 556 bytes:

document.write(`<pre>`+[[/\w./g,`|  $& |`],[/\|\|/g,`|`],[/(.*)-(.*)/g,(_,l,r)=>l+` `.repeat(193-r.length-l.length)+r],[/\n.*/g,s=>s.replace(/ \w./g,_=>(++i<100?` `:``)+i+(i<10?` `:``))+s+s.replace(/  \w. /g,`_____`)],[/ {5}(?=[^]{191}\d)/g,`_____`],[/_ _/g,`___`]].reduce((s,[r,t])=>s.replace(r,t),`-
H -He
LiBe-B C N O F Ne
NaMg-AlSiP S ClAr
K CaSc-TiV CrMnFeCoNiCuZnGaGeAsSeBrKr
RbSrY -ZrNbMoTcRuRhPdAgCdInSnSbTeI Xe
CsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW ReOsIrPtAuHgTlPbBiPoAtRn
FrRaAcThPaU NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg`,i=0))

Explanation: A string contains the list of elements with - and newline added as formatting elements. A number of replacements are used to transform the list of elements into the desired table.

Each element is padded inside a pair of |s.
Consecutive |s are then deleted.
-s are replaced with enough padding to result in a width of 193 characters.
Each line after the first is then replaced with three lines:

A line with all the elements replaced with consecutive integers
The original line of elements
A line with all the elements replaced with _s.

Each integer then has _s placed above it (if it doesn't already have them)
Space-separated _s are joined with _s.

I could probably save a few more bytes using the widely available padStart and padEnd methods.

Great! Thanks! My tiny suggestion: replace 19_84 ``+a.map(s=>r`` 18 to 18_84 ``+a.map(s=>r`` 17. It's does not affect the code length.

@mazzy Huh, I hadn't even noticed that. Thanks!

05AB1E, 517 500 494 459 458 bytes
¾36×•=∊à¢[ΔζÃΓÖoÂÂ›àƶØ4.æßðùùO∊ŸßeÑΘ²9Êλ*βUθÇΔn4üÁ¬₁÷6öć®λJƒÐtvý¢ƶ³≠qΣĆ}εùeÆv]_|ˆ±q₅yÜƵтY¿в{àéÙ•4B«S2ôvyć'#×s'@×})˜2ôvyDJ'@åi'_©5×ëð5×}‚˜.C.B}})18ôvyøvy'|ý2F'|3úûð7×:}D4£ð4×Êi'|ëð}.ø}})ø„ #„_#:ø»…  _û®5×:…__ 2ú®5×:„_ û®3×:.•$›“₄≠÷/¤¿M5PËð—ΓY¢ö>7*ƒße∞™¶£nˆU‘´¾Ã‹Š\S¬ǝüÑ;:œ η|9HœÇâ`η_т<%£¾ÉöJ₄ª"eÄŸµ2ƶ3^_Ω~Ç∍”pgH¤δ%6ΣŽΔΔ9üηΩ+₃¹ºι"¤Qy¶O£ÄˆU«AJdc=ûö÷O´η,lð¢ʒƵy•v'@y.;}57L72 89Ÿ«Ƶ3ƵHŸ«58 71Ÿ«90Ƶ2Ÿ«Jv'#y.;}"57 |""57 $":¶¡ø'$'|6×2úRû©¦«„/\3×2úR.∞:®'|6×„\/3×3ú«:ø»™

Try it online!
-10ish thanks to Emigna
Lets out a long guttural victory screech... Will golf more, but since it's still the shortest...

The Basic Idea
11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12
12 12 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 22
22 22 00 00 00 00 00 00 00 00 00 00 22 22 21 21 22 22
21 22 22 22 21 22 22 22 22 22 22 22 22 22 22 22 22 22
22 22 21 22 22 22 22 22 22 22 22 22 22 22 22 22 21 22
22 22 22 22 22 21 22 22 22 22 22 22 22 22 22 22 22 22
22 22 22 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 22 22 22 22 22 22 22 22 22 22 22 22 22 22 00
00 00 00 22 22 21 22 22 22 22 22 22 22 32 32 32 32 00

I mapped out each of the squares with the first digit being the length of the number and the second digit being the length of the element name. Used this to create the skeleton (if .C and .B didn't exist this would easily be 300-400 bytes):
 _____                                                                                _____
|  #  |                                                                                |  #  |
|  @  |                                                                                |  @@ |
|_____|_____                                                             _____________________________|_____|
|  #  |  #  |                                                           |  #  |  #  |  #  |  #  |  #  |  ## |
|  @@ |  @@ |                                                           |  @  |  @  |  @  |  @  |  @  |  @@ |
|_____|_____|                                                           |_____|_____|_____|_____|_____|_____|
|  ## |  ## |                                                           |  ## |  ## |  ## |  ## |  ## |  ## |
|  @@ |  @@ |                                                           |  @@ |  @@ |  @  |  @  |  @@ |  @@ |
|_____|_____|___________________________________________________________|_____|_____|_____|_____|_____|_____|
|  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |
|  @  |  @@ |  @@ |  @@ |  @  |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
|  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |
|  @@ |  @@ |  @  |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @  |  @@ |
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
|  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |
|  @@ |  @@ |  @@ |  @@ |  @@ |  @  |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
|  ## |  ## |  ## | ### | ### | ### | ### | ### | ### | ### | ### | ### | ### | ### | ### | ### | ### | ### |
|  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|

                   ___________________________________________________________________________________
                  |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |
                  |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |
                  |_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
                  |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## |  ## | ### | ### | ### | ### |
                  |  @@ |  @@ |  @  |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |  @@ |
                  |_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|

This is what the first half of the code accomplishes...
05AB1E, 229 bytes
0 36×•=∊à¢[ΔζÃΓÖoÂÂ›àƶØ4.æßðùùO∊ŸßeÑΘ²9Êλ*βUθÇΔn4üÁ¬₁÷6öć®λJƒÐtvý¢ƶ³≠qΣĆ}εùeÆv]_|ˆ±q₅yÜƵтY¿в{àéÙ•4B«S2ôvyć'#×s'@×})˜2ôvyDJ'@åi'_5×ëð5×}‚˜.C.B}})18ôvyøvy'|ý2F"   |"ûð7×.:}D4£ð4×Êi'|ëð}.ø}})ø„ #„_#:ø»…  _û'_5×:"  __ "'_5×:„_ û'_3×:

Try it online!
Through ugly one-off manipulation and other bullshit that shouldn't exist, I manage to piece together the entire skeleton.

The next part is basically "insert the massive string of letters and numbers that represent the elements". I essentially just compressed, sequentially, all of the letters:
.•$›“₄≠÷/¤¿M5PËð—ΓY¢ö>7*ƒße∞™¶£nˆU‘´¾Ã‹Š\S¬ǝüÑ;:œ η|9HœÇâ`η_т<%£¾ÉöJ₄ª"eÄŸµ2ƶ3^_Ω~Ç∍”pgH¤δ%6ΣŽΔΔ9üηΩ+₃¹ºι"¤Qy¶O£ÄˆU«AJdc=ûö÷O´η,lð¢ʒƵy•

To get:
hhelibebcnofnenamgalsipsclarkcasctivcrmnfeconicuzngageassebrkrrbsryzrnbmotcrurhpdagcdinsnsbteixecsbalahftawreosirptauhgtlpbbipoatrnfrraacrfdbsgbhhsmtdsrgcnnhflmclvtsogceprndpmsmeugdtbdyhoertmybluthpaunppuamcmbkcfesfmmdnolr

You then see me iterate replacing all @ symbols with the appropriate letter (at the end, after placing them all in their appropriate positions, it allows me to use "Title Cased" for the capitals, as each element is separated by whitespace).

Next I make the number string and do the same thing (thanks Emigna):
57L72 89Ÿ«Ƶ3ƵHŸ«58 71Ÿ«90Ƶ2Ÿ«J

Results in:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657727374757677787980818283848586878889104105106107108109110111112113114115116117118585960616263646566676869707190919293949596979899100101102103

Which I then iterate and replace each # with.

After this, the final annoyance was the slashes... My god...
"57 |""57 $":¶¡ø'$'|6×2úRû©¦«"\/\/\/  ".∞.;®'|6×"   \/\/\/"«.;ø»

This 50 byte monstrosity is what I want to fix, along with multiple other small things... So I'll continue to golf, and until I fix the things I want to this will be the informal explanation.

0 36 to ¾36. 104 118Ÿ to Ƶ3ƵHŸ. 90 103Ÿ to 90Ƶ2Ÿ.

Letter string can be žn•2ƒj#GÂjηCóÛƒüq™ôD ‡yΣ›aÎý1õçñ}ÂćÕ%…7¬vù~GÈž£_DвÌi¸7âòÜë8{~å≠’ˆ—d*^Ý¬©Úì#Ï»cDYyÍæηмm¾/5ä):Ω8+“j¼[)ÿ—θ7I₆н¦ʒâÒ₂иofÞIa¥©ÂÛé/VÖt[¼m¦mćó,≠+ŒtC?8@Ú¬¼½k]αεßÁ'‡≠=aÔºø•51вè.

The number string could be 57L72 89Ÿ«Ƶ3ƵHŸ«58 71Ÿ«90Ƶ2Ÿ«J

That letter compression doesn't seem to be correct.

It appears that SE removes something so it doesn't work pasted here but it works on TIO.

@Emigna found a better solution anyhow :).

You beat bubblegum? What is this madness?

@eaglgenes101 this can still easily drop off ~50 bytes with the newest 05AB1E commands for sure. Also this took 3 hours of mildly infuriating trial and error.

420 bytes - since it's too big for a comment, here a pastebin with the changes (note: it's now using the new version of 05AB1E, where the run-length decode builtin is available).

Ruby, 567 558 bytes
a=[?|]*21
j=r=0
118.times{|i|a[r]+="%4s |"%("%-2d"%-~i)
a[r+1]+="  #{'H HeLiBeB C N O F NeNaMgAlSiP S ClArK CaScTiV CrMnFeCoNiCuZnGaGeAsSeBrKrRbSrY ZrNbMoTcRuRhPdAgCdInSnSbTeI XeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW ReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaU NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg'[i*2,2]} |"
a[r+2]+=?_*5+?|
i>j&&(j+=(r/6+2)**2*2;r+=3)}
a<<' '+?_*84
6.times{|r|a[r+3][13]=' _'[r/5]*59+?|+d='  _'[r%3]
r<3&&a[r][7]=d*5+' '*61+d*29+?|+d
a[r+=15][18]=a[r][102]='/\\'[r%2]
a<<' '+a[r][18,85]
a[r][18,84]=''}
puts ' _____'+' '*97+?_*5,a

Try it online!
Brought the La/Ac series closer to the main table (re reading of the rules suggests it's allowed;  rearranged formatting section so d is used immediately when calculated; and next row calculated mathematically instead of by regex.
Ruby, 587
score excludes 3 unnecessary newlines added for clarity
a=[?|]*21
r=0

118.times{|i|
a[r]+="%4s |"%("%-2d"%(i+1))
a[r+1]+="  #{e='H HeLiBeB C N O F NeNaMgAlSiP S ClArK CaScTiV CrMnFeCoNiCuZnGaGeAsSeBrKrRbSrY ZrNbMoTcRuRhPdAgCdInSnSbTeI XeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW ReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaU NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg'[i*2,2]} |"
a[r+2]+="_____|"
"HeNeArKrXeRn"=~/#{e}/&&r+=3}

6.times{|r|d='  _'[r%3]
r<3&&a[r][7]=d*5+' '*61+d*29+?|+d
a[r+3][13]=' _'[r/5]*59+?|+d
a[r+15][18]=a[r+15][102]='\//'[r%2]
a[r+23]=' '*18+a[r+15][18,85]
a[r+15][18,84]=''}

a[22]=' '*18+?_*84
puts ' _____'+' '*97+?_*5,a

Explanation
The idea is to produce the following, then modify it by adding the correct padding and formatting, and moving the lanthanides and actinides to the bottom.
|  1  |  2  |
|  H  |  He |
|_____|_____|
|  3  |  4  |  5  |  6  |  7  |  8  |  9  |  10 |
|  Li |  Be |  B  |  C  |  N  |  O  |  F  |  Ne |
|_____|_____|_____|_____|_____|_____|_____|_____|
|  11 |  12 |  13 |  14 |  15 |  16 |  17 |  18 |
|  Na |  Mg |  Al |  Si |  P  |  S  |  Cl |  Ar |
|_____|_____|_____|_____|_____|_____|_____|_____|
|  19 |  20 |  21 |  22 |  23 |  24 |  25 |  26 |  27 |  28 |  29 |  30 |  31 |  32 |  33 |  34 |  35 |  36 |
|  K  |  Ca |  Sc |  Ti |  V  |  Cr |  Mn |  Fe |  Co |  Ni |  Cu |  Zn |  Ga |  Ge |  As |  Se |  Br |  Kr |
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
|  37 |  38 |  39 |  40 |  41 |  42 |  43 |  44 |  45 |  46 |  47 |  48 |  49 |  50 |  51 |  52 |  53 |  54 |
|  Rb |  Sr |  Y  |  Zr |  Nb |  Mo |  Tc |  Ru |  Rh |  Pd |  Ag |  Cd |  In |  Sn |  Sb |  Te |  I  |  Xe |
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
|  55 |  56 |  57 |  58 |  59 |  60 |  61 |  62 |  63 |  64 |  65 |  66 |  67 |  68 |  69 |  70 |  71 |  72 |  73 |  74 |  75 |  76 |  77 |  78 |  79 |  80 |  81 |  82 |  83 |  84 |  85 |  86 |
|  Cs |  Ba |  La |  Ce |  Pr |  Nd |  Pm |  Sm |  Eu |  Gd |  Tb |  Dy |  Ho |  Er |  Tm |  Yb |  Lu |  Hf |  Ta |  W  |  Re |  Os |  Ir |  Pt |  Au |  Hg |  Tl |  Pb |  Bi |  Po |  At |  Rn |
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
|  87 |  88 |  89 |  90 |  91 |  92 |  93 |  94 |  95 |  96 |  97 |  98 |  99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 |
|  Fr |  Ra |  Ac |  Th |  Pa |  U  |  Np |  Pu |  Am |  Cm |  Bk |  Cf |  Es |  Fm |  Md |  No |  Lr |  Rf |  Db |  Sg |  Bh |  Hs |  Mt |  Ds |  Rg |  Cn |  Nh |  Fl |  Mc |  Lv |  Ts |  Og |
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|

Commented code
a=[?|]*21                                #setup array with |s for left hand side
r=0                                      #row counter

118.times{|i|                            #For each element add to the correct row
a[r]+="%4s |"%("%-2d"%(i+1))             #the atomic number
a[r+1]+="  #{e='H HeLiBeB C N O F NeNaMgAlSiP S ClArK CaScTiV CrMnFeCoNiCuZnGaGeAsSeBrKrRbSrY ZrNbMoTcRuRhPdAgCdInSnSbTeI XeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW ReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaU NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg'[i*2,2]} |"
a[r+2]+="_____|"                         #the element symbol and the blank space at the bottom.
"HeNeArKrXeRn"=~/#{e}/&&r+=3}            #If it is element from last column, increment r

6.times{|r|d='  _'[r%3]                  #What symbol (_ or space)do we need to pad?
r<3&&a[r][7]=d*5+' '*61+d*29+?|+d        #Move He to the right
a[r+3][13]=' _'[r/5]*59+?|+d             #Move row 2&3 elements to the right
a[r+15][18]=a[r+15][102]='\//'[r%2]      #Draw breaks for La and Ac series
a[r+23]=' '*18+a[r+15][18,85]            #Copy La and Ac series
a[r+15][18,84]=''}                       #Delete original La and Ac series from main table

a[22]=' '*18+?_*84                       #Draw top on La and Ac series
puts ' _____'+' '*97+?_*5,a              #Output top of row 1, followed by array containing the rest of the table.

IMO it should be allowed to leave the rare earths inline. What would be your score in that version?

I just commented the code. I could delete a[r+15][18]=a[r+15][102]='\//'[r%2];a[r+23]=' '*18+a[r+15][18,85];a[r+15][18,84]='' saving 83 bytes, and possibly a[22]=' '*18+?_*84 On the other hand I would have to put a gap in rows 4 and 5 above the rare earths so there would be additional code for that. It's difficult to say what the score would be without doing it but it would be shorter.

C, 1415 1401 1395 1367 1345 1277 1159 1052 1043 bytes
#define P printf(
#define L;P"|\n")
#define M;p(18," ")
#define D L;B
#define K;P"\\\n")M;P
#define Q;P"|%59c",32)
char*l="HHeLiBeBCNOFNeNaMgAlSiPSClArKCaScTiVCrMnFeCoNiCuZnGaGeAsSeBrKrRbSrYZrNbMoTcRuRhPdAgCdInSnSbTeIXeCsBaLaTaWReOsIrPtAuHgTlPbBiPoAtRnFrRaAcDbSgBhHsMtDsRgCnNhFlMcLvTsOgPrNdPmSmEuGdTbDyHoErTmYbLuPaUNpPuAmCmBkCfEsFmMdNoLr",U[]="|_____",*u=U+1;a;p(n,s)int*s;{while(n--)P s);}A(n){for(n+=a;a<n;++a)P a>9?"%c%4d ":"%c%3d  ",a^72*a^58?a^90*a^104?'|':47:92,a);}B(n){for(;n--;P"%c ",*l>96?*l++:32))P"|%3c",*l++);}N(){A(18)D(18)L;p(18,U)L;}f(){P" %s%102s\n",u,u);A(a=1);P"|%95c",32);A(1)D(1);P"|%95c",32);B(1)L;P"%s%-67s",U,U);p(5,u);P"____%s|\n",U);A(2)Q;A(6)D(2)Q;B(6)L;p(2,U)Q;p(6,U)L;A(2)Q;A(6)D(2)Q;B(6)L;P"|%s|%s|",u,u);p(11,u);P u+1);p(6,U)L;N(N());A(3);a=72;A(15)D(3);P"/  Hf ");B(14)L;p(3,U);P"\\%s",u);p(14,U)L;A(3);a=104;A(15)D(3);P"\\  Rf ");B(14)L;p(3,U);P"/%s",u);p(14,U)L;P"\n")M;p(84,"_");P"\n")M;a=58;A(14)K"/  Ce ");B(13);P"/\n")M;P"\\%s",u);p(13,U)K"");a=90;A(14);P"/\n")M;P"\\  Th ");B(13)K"/%s",u);p(13,U);P"/");}

Thanks to @Conor O'Brien for saving 6 bytes!
Thanks to @Zacharý for saving 22 90 bytes!
Thanks to @gastropner for saving 118 225 bytes!
Thanks to @ceilingcat for saving 8 9 bytes!
Try it online!
Unrolled (1159 bytes version):
#define P printf(
#define L;P"|\n")
#define M;p(18," ")
#define D L;B
#define N(n)A(n,n+18)D(18)L;p(18,U)L;
#define K;P"\\\n")M;P
#define C char
#define Q;P"|%*c",59,32)
C*u,
*l,
*U="|_____",
S[4];

p(n,s)C*s;
{
    P s,
    --n&&p(n,s));
}

b(k)
{
    k=P"|  %s",S);
    P"%*c",6-k,32);
}

e(s)C*s;
{
    *s++=*l++;
    *s=*l>96?*l++:0;
}

A(a,n)
{
    for(;a<n;++a)
        P a>9?"|%4d ":"|%3d  ",a);
}

B(n)
{
    for(;n--;)
        b(e(S));
}

f()
{
    u=U+1;
    l="HHeLiBeBCNOFNeNaMgAlSiPSClArKCaScTiVCrMnFeCoNiCuZnGaGeAsSeBrKrRbSrYZrNbMoTcRuRhPdAgCdInSnSbTeIXeCsBaLaTaWReOsIrPtAuHgTlPbBiPoAtRnFrRaAcDbSgBhHsMtDsRgCnNhFlMcLvTsOgPrNdPmSmEuGdTbDyHoErTmYbLuPaUNpPuAmCmBkCfEsFmMdNoLr";
    P" %s%*s\n",u,102,u);
    A(1,2);
    P"| %*c",94,32);
    A(2,3)
    D(1);
    P"| %*c",94,32);
    B(1)L;
    P"%s%s%*c",U,U,61,32);
    p(5,u);
    P"____%s|\n",U);
    A(3,5)Q;
    A(5,11)
    D(2)Q;
    B(6)L;
    p(2,U)Q;
    p(6,U)L;
    A(11,13)Q;
    A(13,19)
    D(2)Q;
    B(6)L;
    P"|%s|%s|",u,u);
    p(11,u);
    P u+1);
    p(6,U)L;
    N(19)
    N(37)
    A(55,58);
    P"\\  72 ");
    A(73,87)
    D(3);
    P"/  Hf ");
    B(14)L;
    p(3,U);
    P"\\%s",u);
    p(14,U)L;
    A(87,90);
    P"/ 104 ");
    A(105,119)
    D(3);
    P"\\  Rf ");
    B(14)L;
    p(3,U);
    P"/%s",u);
    p(14,U)L;
    P"\n")M;
    p(84,"_");
    P"\n")M;
    P"\\  58 ");
    A(59,72)
    K"/  Ce ");
    B(13);
    P"/\n")M;
    P"\\%s",u);
    p(13,U)
    K"/  90 ");
    A(91,104);
    P"/\n")M;
    P"\\  Th ");
    B(13)
    K"/%s",u);
    p(13,U);
    P"/");
}

You can save at least 1 byte by reducing the space count before the 2nd part as it just has to be one space longer than the 1st part

@dzaima Thanks, but I think it looks much nicer when the second part is aligned with the first.

You can save 2 bytes by #defineing char*

@ConorO'Brien 6 bytes, actually. Thanks!

And ... you forgot three printf( occurrences, here is a link to your code with those three occurrences replaced with the P macro: https://repl.it/Jeat/1

Even more bytes can be shaved by #define-ing ;L;B: https://repl.it/Jeat/3

Sorry for all the spamming, but I got it down to 1,277 with extreme macro abuse https://repl.it/Jeat/9.

@Zacharý That's quite impressive!

Found a few more things to squeeze to get it to 1157
Code and changes

I was too hasty it seems! 1159 after having made f() reusable again: Code

@gastropner Thanks! 118 bytes shorter, that's quite an improvement!

-107 for 1052 Code

1012 bytes

PowerShell, 1562 bytes
cls
nal w write-host
$u="_"
$q=" "
$a=@('','H','He','Li','Be','B','C','N','O','F','Ne','Na','Mg','Al','Si','P','S','Cl','Ar','K','Ca','Sc','Ti','V','Cr','Mn','Fe','Co','Ni','Cu','Zn','Ga','Ge','As','Se','Br','Kr','Rb','Sr','Y','Zr','Nb','Mo','Tc','Ru','Rh','Pd','Ag','Cd','In','Sn','Sb','Te','I','Xe','Cs','Ba','La','Ce','Pr','Nd','Pm','Sm','Eu','Gd','Tb','Dy','Ho','Er','Tm','Yb','Lu','Hf','Ta','W','Re','Os','Ir','Pt','Au','Hg','Tl','Pb','Bi','Po','At','Rn','Fr','Ra','Ac','Th','Pa','U','Np','Pu','Am','Cm','Bk','Cf','Es','Fm','Md','No','Lr','Rf','Db','Sg','Bh','Hs','Mt','Ds','Rg','Cn','Nh','Fl','Mc','Lv','Ts','Og')
function b($s,$x,$y){[console]::setcursorposition($x,$y);w $s -n}
function v($n,$m,$i,$p){$x=$n;$i..$p|%{$y=$m;b $_ $x $y;$y++;if($_-gt99){$x++};b $a[$_] $x $y;if($_-gt99){$x--};$x=$x+6}}
w (($u*6)*18)-n;w""
0..8|%{if($_-eq7){w"";w (($u*6)*18)-n;w""}w ("|     "*18)-n;w "|";w ("|     "*18)-n;w "|";w ("|_____"*18)-n;w "|"}
$y=0;0..2|%{7..101|%{b $q $_ $y};$y++};$x=12;$t=$q;0..84|%{if($_-eq61){$t="_"}b $t $x 3;$x++};4..9|%{$y=$_;$t=$q;if($_-eq9){$t=$u};13..71|%{b $t $_ $y}}
$y=23;0..6|%{$x=0;0..18|%{b $q $x $y;$x++};$x=103;0..5|%{b $q $x $y;$x++};$y++}
$x=18;$y=16;0..6|%{b "\" $x $y;$y++;b "/" $x $y;$y++}
$x=102;$y=24;0..2|%{ b "\" $x $y;$y++;b "/" $x $y;$y++}
0,6,102|%{b $q $_ 0}
22,23|%{b $q 18 $_}
b $q 102 23
v 3 10 19 36;v 3 13 37 54;v 3 16 55 57;v 21 16 72 86;v 3 19 87 89;v 20 19 104 118;v 21 24 58 71;v 21 27 90 99;v 80 27 100 103;v 3 1 1 1;v 105 1 2 2;v 3 4 3 4;v 75 4 5 9;v 105 4 10 10;v 3 7 11 12;v 75 7 13 18
b "" 0 30
pause

This approach is not optimal. Can't use tio since this leverages [console]::setcursorposition.

SOGL V0.11, 311 bytes
f¤o3,hģ_lμgΣ│Τ┐xC‚¦⁽?%□f⁵↕υ/gκ÷⌠‚ξ#.ν⁵‰↕¦δ┌_jυ1ιīΒ=λ←ļ,ξ╚Ƨu≡ā⁄b⅔►<≡7⅛±√‽ε¶&⁶7zV¾UΥY○ΝΚq╬#∫⅜āΡ⁴7‼%Æ«∑+‼Ψ_№QΕ¦→3γ:Ηρ':υy7▒Ξυσ╤ņcΗOī{═─⁷׀Uγlλ№γjΒ%G≤§┐⌠≈δ{oR{ΘKUƨA▒V⁶ ³‘2n '`Δ"²zōdΕ«⅝←╝⅔πφ“'³─◄"³υ≥τk┐?№L‚↑γ°“'³─6«{K;K;A{:I}a}X¹¹Hā;{⁾J6*;J3*;Jl1=@*+l3κ@*ΚΚ"<Ψ:$ō∫ΣO±>⁄‘7nž}"‛‽‛№l№’2n{_"□׀⁵‘čž}"O⁶‛±0±‛¤3¤M¤’2n{_"Ρ8‘ž

This took a while. To make this that compact, I've implemented many things into SOGL (most of which were already documentated). Most notably,

"ž", which places an array inside another array at specific coordinates, and
"►" and "◄" - run-length encode and decode. I really thought I had documentated them, but I guess I hadn't.

Try it Here! (compression (lazily) updated to comply with 0.12)
So, overly long explanation ahead:
First part: setup
f¤o3,hģ_lμgΣ│Τ┐xC‚¦⁽?%□f⁵↕υ/gκ÷⌠‚ξ#.ν⁵‰↕¦δ┌_jυ1ιīΒ=λ←ļ,ξ╚Ƨu≡ā⁄b⅔►<≡7⅛±√‽ε¶&⁶7zV¾UΥY○ΝΚq╬#∫⅜āΡ⁴7‼%Æ«∑+‼Ψ_№QΕ¦→3γ:Ηρ':υy7▒Ξυσ╤ņcΗOī{═─⁷׀Uγlλ№γjΒ%G≤§┐⌠≈δ{oR{ΘKUƨA▒V⁶ ³‘2n

...‘    push "h helibeb c n o f nenamgalsip s clark casctiv crmnfeconicuzngageassebrkrrbsry zrnbmotcrurhpdagcdinsnsbtei xecsbalaceprndpmsmeugdtbdyhoertmybluhftaw reosirptauhgtlpbbipoatrnfrraacthpau nppuamcmbkcfesfmmdnolrrfdbsgbhhsmtdsrgcnnhflmclvtsog"
    2n  split into an array with items of length 2
These are the element names, conveniently already shaped how they should be.

'`Δ
'`   push 118
  Δ  range - all numbers from 1 to 118
These are atomic numbers

"²zōdΕ«⅝←╝⅔πφ“'³─◄
"...“      push 794198124771504466790502538
     '³    push 19
       ─   base [19] decode - resulting to array [1, 2, 2, 8, 3, 8, 4, 18, 5, 18, 6, 3, 9, 14, 6, 15, 7, 3, 10, 14, 7, 15]
        ◄  run-length decode
Final result: [1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]
These are the periods, with 9 and 10 for lanthanides and actinides respectively.

"³υ≥τk┐?№L‚↑γ°“'³─6«{K;K;A{:I}a}X¹

"...“                     push 270687554118568732622432847987
     '³─                  base 19 decode, resulting in [1, 0, 18, 0, 1, 1, 13, 5, 1, 1, 13, 5, 1, 17, 1, 17, 1, 16, 4, 14, 1, 16, 4, 14]
        6«{          }    repeat 12 times
           K;K;             get the 1st 2 items of the array below the array (e. g:      ..., 13, 5, [1, 1, 13, 5, 1, 17, 1, 17, 1, 16, 4, 14, 1, 16, 4, 14])
               A            save the array on variable A (so it doesn't get in the way)  ..., 13, 5
                {  }        repeat POP times                                             ..., 13
                 :            duplicate the number                                       ..., 13, 13
                  I           increase it                                                ..., 13, 14
                              and so on (e.g. 5 times, resulting in 6 numbers)           ..., 13, 14, 15, 16, 17, 18, [1, 1, 13, 5, 1, 17, 1, 17, 1, 16, 4, 14, 1, 16, 4, 14]
                    a       load back the array
                            repeating that all 12 times
                      X   remove the array off of the stack
                       ¹  wrap all of those numbers in an array
Final result: [1, 18, 1, 2, 13, 14, 15, 16, 17, 18, 1, 2, 13, 14, 15, 16, 17, 18, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
These are the periods, which could be so nicely compressed, because if the atomic numbers are sorted, these are too.

Second part: loop
¹Hā;{
¹      wrap all those 4 arrays into one big array
 H     rotate it left
            [[a, b, c],         [["c", 3, 6]
         So  [1, 2, 3], becomes  ["b", 2, 5] . Now the sub-array structure is [name, atomic number, group, period]
             [4, 5, 6]]          ["a", 1, 4]]
         A couple important things about this:
           - it makes each new sub-array contain all the data from all the arrays at a constant index
           - it reverses the indexes - a,b,c were given in, but now, in each sub-array, the first items are c, b, a.
             This is important because the last elements would get drawn first, so everything would appear correctly. See https://gist.github.com/dzaima/221d1792e03d0429e3403cf255c66926 for what would happen if it didn't get reversed.
  ā;   push an empty array below that big array
    {  for each sub-array

⁾J6*;J3*;
⁾          sentence-case the items in the array, ignoring the numbers. Capitalizes the 1st letter of the name
 J         pop get the last item of the array               [["Au", 79, 6], 11]
  6*       multiply it by 6 - the X coordinate              [["Au", 79, 6], 66]
    ;      swap, geting the array above                     [66, ["Au", 79, 6]]
     J     pop get the last item of the array               [66, ["Au", 79], 6]
      3*   multiply it by 6 - the Y coordinate              [66, ["Au", 79], 18]
        ;  swap, geting the array above                     [66, 18, ["Au", 79]]

Jl1=@*+l3κ@*ΚΚ"<Ψ:$ō∫ΣO±>⁄‘7nž}
J                        get the 1st item of the array               [84, 6, ["C "], 6]             [66, 18, ["Au"], 79]            [96, 21, ["Lv"], 116]
 l                       get length                                  [84, 6, ["C "], 6, 1]          [66, 18, ["Au"], 79, 2]         [96, 21, ["Lv"], 116, 3]
  1=                     push if [length] = 1                        [84, 6, ["C "], 6, 1]          [66, 18, ["Au"], 79, 0]         [96, 21, ["Lv"], 116, 0]
    @*                   get that many spaces                        [84, 6, ["C "], 6, " "]        [66, 18, ["Au"], 79, ""]        [96, 21, ["Lv"], 116, ""]
      +                  join                                        [84, 6, ["C "], "6 "]          [66, 18, ["Au"], "79"]          [96, 21, ["Lv"], "116"]
       l                 get length                                  [84, 6, ["C "], "6 ", 2]       [66, 18, ["Au"], "79", 2]       [96, 21, ["Lv"], "116", 3]
        3κ               do 3-[length]                               [84, 6, ["C "], "6 ", 1]       [66, 18, ["Au"], "79", 1]       [96, 21, ["Lv"], "116", 0]
          @*             get that many spaces                        [84, 6, ["C "], "6 ", " "]     [66, 18, ["Au"], "79", " "]     [96, 21, ["Lv"], "116", ""]
            Κ            prepend those                               [84, 6, ["C "], " 6 "]         [66, 18, ["Au"], " 79"]         [96, 21, ["Lv"], "116"]
             Κ           prepend that in the array                   [84, 6, [" 6 ", "C "]]         [66, 18, [" 79", "Au"]]         [96, 21, ["116", "Lv"]]
              "...‘      push " _____ | ŗ ||  ŗ ||_____|", replacing ŗ with the correspoding item form the array  [66, 18, " _____ |  79 ||  Au ||_____|"]
                   7n    split that into an array of items of length 7                                            [66, 18, " _____ ", "|  79 |", "|  Au |", "|_____|"]
                     ž   set that array at the positions [66, 18] in the array below
                      }  end the for-each loop

So now the output looks like this.
Third part: Add-ons
"‛‽‛№l№’2n{_"□׀⁵‘čž}
"...’           }  push code page indexes of the chars          [24, 19, 24, 28, 108, 28]
     2n            split into an array of items of length 2     [[24, 19], [24, 28], [108, 28]]
       {           for each sub-array
        _            push all the arrays contents on the stack  [24, 19]
         "...‘       push "\/\/\/"                              [24, 19, "\/\/\/"]
              č      split into a char-array                    [24, 19, ["\", "/", "\", "/", "\", "/"]]
               ž     replace in the mother array at coordinates [e.g. 24, 19] with those chars

"O⁶‛±0±‛¤3¤M¤’2n{_"Ρ8‘ž
"...’           push code page indexes of the chars          [79, 6, 24, 12, 48, 12, 24, 27, 51, 27, 77, 27]
     2n         split into an array of items of length 2     [[79, 6], [24, 12], [48, 12], [24, 27], [51, 27], [77, 27]]
       {        for each sub-array (implicitly closed)
        _         push all the arrays contents on the stack  [79, 6]
         "Ρ8‘     push "_____________________________"       [79, 6, "_____________________________"]
             ž    replace in the mother array at coordinates [e.g. 79, 6] with that string

Oh lord, why was this non-competing? This mauls the answer I wasted 3 days on.

@carusocomputing he implemented new builtins for it I believe

@caruscomputing Yes, the first paragraph says that I implemented new builtins

Ahhh.. I misread "(most of which were already documentated)."

Bash, 728 bytes
Tested on Ubuntu, requires base64 and xz programs
echo "XQAAgAD//////////wAQF/CEG6nfcFqpw6CdrU+LkV2iM1yxHU1IDYDEgH/atWuFbJGeeBZu5o8S+/6JEYEvLgTKL3JLS1cREFe2iyLK+lMZU9vuTOkuUG6NIz7n9f+iz8j4iMrKqTRVBrSzmeiXXQJA2EEOcgg/Y7Cb6ZjVoTXmo4dAV4bjgMUS0paPWZHNKKZ101VPerG6mof4Rv8UrX/CNmkvxSGG0GKHhaWpHsM6WnTzEU2L8BbDQjYsHlSUzsLj0JdMO8SFR1mlbNtyxZej1s7c4eGy2jBUCq+dCMxFt5W0AOoEHIGKy3zsmqcrJqTnKXVHOUKDiDTel3GaRm3+5fBEc1lXeN1nPli3Id6D1hzIN92eYP4JSrgyrp4t142mJ3U22iTdzO4mctwmjbmdAmFqp8hwIHM4M1n0F6DgfF0bNkROTMRWJC/CQBAkJHARwwol3z2lFsjaReJnTr0rvDvkBfuIPgzjNhFPR2xT55MaN1DKZbPOSsd1r+zZre+XSZD9ViDuGq5xlpmOyiIPRcbNJWpwo7s5mjGkDGtu6+FHygaV5bmTnnGTV0uKtxpSn1MdttXh9CRWTMXBVaIT6RllKQhzgoSUMFbrVQBqKJ/7t7fNouBxhORQRb4DmZJbZ5A1cFhvQflxdHxNkdzZDs7U4DE31j96IhXbO5MirWl2ENWMO1s//QpX8w=="|base64 -d|xz -d

Explanation
LZMA (Lempel-Ziv-Markov chain-Algorithm) produced about 0,5K archive with periodic table.
It contains unprintable symbols, and can't be used directly in console. To use it i encoded it by Base64
echo "base64_string" | base64 -d | xz -d

Stream redirection is used to decode and uncompress archive.
Tricks
To save about 30 bytes i deleted newline and some spaces

You can save a couple of bytes using a here document (base64 -D<<Q|xz -d followed by the base64 code on its own line and a trailing Q).

@Charphacy What you mean? I tried to replace Q by base64 string and by "echo base64_string", and it doesn't working. Can you upload example to pastebin?

what a lazy approach. I love it.

PHP, 758 Bytes
After very little chance to golf down my array approach I decide to work only with strings
Online Version
$p=($d=str_pad)("",3410,$d("",109)."\n");foreach(str_split("H HeLiBeB C N O F NeNaMgAlSiP S ClArK CaScTiV CrMnFeCoNiCuZnGaGeAsSeBrKrRbSrY ZrNbMoTcRuRhPdAgCdInSnSbTeI XeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW ReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaU NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg",2)as$k=>$v){!in_array($k,$b=[2,10,18,36,54,86])?:$c++;foreach([" _____ ","| ".$d($k+1,3," ",$k<9?2:0)." |","|  $v |",$o="|_____|"]as$m=>$n)$p=substr_replace($p,$m<1&substr($p,-110+$q=(($i=($k>70&$k<86|$k>102?$k-14:$k)-$b[$c-1])+($k!=1?$c<3&$i>1?10:0:16))*6+110*$m+330*($k>56&$k<71|$k>88&$k<103?$c+3:$c),1)=="|"?$o:$n,$q,7);}$p[342]=" ";for($w=5;$w<9;$w++)for($u=0;$u<3;){$p[$l=($w>6?$w+1:$w)*330+128+$u*110]=$j=($w+$u++)%2?"\\":"/";if($w>6)$p[$l+84]=$j;}echo$p;

Expanded
$p=($d=str_pad)("",3410,$d("",109)."\n");
foreach(str_split("H HeLiBeB C N O F NeNaMgAlSiP S ClArK CaScTiV CrMnFeCoNiCuZnGaGeAsSeBrKrRbSrY ZrNbMoTcRuRhPdAgCdInSnSbTeI XeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW ReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaU NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg"
,2)as$k=>$v){
!in_array($k,$b=[2,10,18,36,54,86])?:$c++;
foreach([" _____ ","| ".$d($k+1,3," ",$k<9?2:0)." |","|  $v |",$o="|_____|"]as$m=>$n)
$p=substr_replace($p,
$m<1&substr($p,-110+$q=(($i=($k>70&$k<86|$k>102?$k-14:$k)-$b[$c-1])+($k!=1?$c<3&$i>1?10:0:16))*6+110*$m+330*($k>56&$k<71|$k>88&$k<103?$c+3:$c),1)=="|"?$o:$n
,$q,7);
}
$p[342]=" ";
for($w=5;$w<9;$w++)for($u=0;$u<3;){
$p[$l=($w>6?$w+1:$w)*330+128+$u*110]=$j=($w+$u++)%2?"\\":"/";
if($w>6)$p[$l+84]=$j;}
echo$p;

PHP, 892 Bytes
First working solution that is under the byte count of the compress version a solution with arrays
Online version
$p=array_fill(0,9,($z=($d=str_pad)("",109)."\n").$z.$z);foreach(str_split("H HeLiBeB C N O F NeNaMgAlSiP S ClArK CaScTiV CrMnFeCoNiCuZnGaGeAsSeBrKrRbSrY ZrNbMoTcRuRhPdAgCdInSnSbTeI XeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW ReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaU NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg",2)as$k=>$v){if(array_search($k,$b=[0,2,10,18,36,54,86]))$c++;$g=$k>56&$k<71|$k>88&$k<103?$c+2:+$c;$x=$k>70&$k<86|$k>102?$k-14:$k;foreach(["| ".$d($k+1,3," ",$k<9?2:0)." |","|  $v |","|_____|"]as$m=>$n)$p[$g]=($r=substr_replace)($p[$g],$n,(($i=$x-$b[$c])+($c<3&$i>1?10:(!$c&$i>0?16:0)))*6+110*$m,7);}for($w=5;$w<9;$w++)for($u=0;$u<3;$u++){$p[$w][18+$u*110]=($w+$u)%2?"\\":"/";if($w>6){$p[$w][102+$u*110]=($w+$u)%2?"\\":"/";}}echo$d(" _____",103)."_____\n";$p[0]=$r($p[0],_____,227,5);$p[0]=$r($p[0],$d("",29,"_____ "),293,29);$p[2]=$r($p[2],$d("",59,"_____ "),233,59);echo join($p);

PHP, 783 Bytes
Try it online!
Only using compressing
<?=bzdecompress(base64_decode("QlpoNDFBWSZTWYVVkt4AAXB/gCATACBAAP/gP+/f/r/v3yRAAlyZOzuIImgm0BNCJp6T0yQyaAeo000aNqYQrVMU895VSANAAAAAAGmnpAhqoB+1U9QaDQGgAA0ADQAESiieo/SgAAAAAAAANOlBWqLi6XHyC67CCYFu36ImFcCYYSqFERuisi0SA3RCkEKQBkUSsQARADINCeNmOimrFjyW6NWiy7Vp78ujxo434qwygFgmA4mABAxjGA1f9k1pmrrQfSjNsDbvcgetiknNCks756IrcRERRYABMoAAqAEzczMzKCqgAACqgTMzMoaftix6GTLlyYsd92rSy+qyuyu38Ja5t2r3njIeaoULsW+FtUVTKXFADFjUAp1EHjMhLOQkUqZJhPNPGSkUz0IbVHm+kYpfJF1111ttttpERXMYxjQ+QENZxYzMzM5zmVUdJjEkkkzCAqoAioAAAAAEC4AAVRiKVVKqrLEUtqAAGWIpgAVVGIpYVqqtzEUtqkAVliI9MFVFcOHDfffZStrWta1rWsKJfEUyYZUIUpUEVOelAgBgA2nYcAOIHEABglv/sNt+u/gI3pwL6w4LQTEk79PxgktzXtEWfjlwmU9zEyStSha5DECpMVMdyJe5cHqWeGEIzOY2PKEx5RlU9sjzoJFDVLzGN1AYAEQ4CI5xMB8VBKRZEaxKQAJBaRJFaRSRlaDSEgkgJIAOADFArBJJJEHCRUaMP8XckU4UJCFVZLeA"));

PHP, 948 Bytes
<?=gzinflate(base64_decode("vZbbattAFEXfA/mH+QNrNPdHSb4S35CVtgkGk6ZpWtqmxW0KBX98pTVuKfgCRSh62Mjj2XM4a/aMLTbNI7p+qHJ5sRNCCrHruFi9flor5cYvUm78QDm63LUnujn37KvQnaK6btdj7TWoRR3q0YDKZA9z+rH5mD+0LZejBTpHF+gwjhzAbFXu33VOaUympNm0bXdSoRo1qEUd6vcw53fNx9lj23LZ50ZXbM2SkVXEy3i2PYB5Nl3nn/+AGTiGCQrYFLApcFLgpMBJgZMCJ/UoXoVX4VV4FV6FV+FVdg/zKrYM0tV9oxVAXsXxLaifyBjpLb6SNOYUz43e8u2IFUbMyb6zGu85K1ydgNmhxmMOHAUcBRwNHA0cDRwNHA0cDRwNWI1X49V4DV6D1+A1eI3ewyzf0jgt3wDwlvc54zPQVUAuQVd+IHvvgEaeC94nIF1FxVsBc8Kabw6P+YvANMAxwDFOrOsbDwgOCA6AjjmOOQ6ADoAOgB6AHoAer8fr8Xq8/k8yC1KUk6vpnejVPxbvQcHIa1CUYFkwcwLq5Q9ggncM0orjvARjHg87G5Exs3w6DnPdMUwPHA8cH+ruZNJAkIlBLepQjzYAZfODUqtEU1SheLkzJXem5M6Uf+/MIXBK0GX3zd6VwOzHxAIqJ41jYM6A0+e9jMkkjXPmDEE6I8nTn0Bm5uLxOMxelzAvLw5v900HjzhWqAZp2ENDwC0BtwTcEnBLwC0BtwTccjgs+2/xWrwOr5NifaxQHf+CsC/jjcI9sfzC7qEDIj9ivGJX+7/YT8I+wFUx84Zvp8+id7SjDnbpVEeBlgO4ArgCuAK4ArgCuAK4ArgCRyHhKCQchYSjkKgTHdWNx4uW+F/H/0rfGAFaBpYCzT/xzuEYEOoh4zPAzoE53Z7Yow7Q9X4D"));

Bubblegum, 600 bytes
00000000: c4d5 4572 e430 0040 d17d 4ea1 1bb4 d9ee  ..Er.0.@.}N.....
00000010: 5d98 9999 9b86 990f 3ff6 cb2e 1546 2f5e  ].......?....F/^
00000020: a94c 8abe d595 70d4 1ce1 b90f b30c fd0b  .L....p.........
00000030: 210e a1f6 190f ef4f 6a9b d9a6 5f64 b6e9  !......Oj..._d..
00000040: 4e33 9b25 5ef8 f854 d71d ff68 6da9 b933  N3.%^..T...hm..3
00000050: 3ee6 afcf 59b0 64c5 36e3 48c9 303f 08b5  >...Y.d.6.H.0?..
00000060: a39d c7ce 36ca 312e 7289 935c bc5c f251  ....6.1.r..\.\.Q
00000070: b379 c32d da93 b195 268f 5d5b 9c32 63ce  .y.-....&.][.2c.
00000080: 8225 2b25 c3e2 49a8 5de8 3d76 b691 778d  .%+%..I.].=v..w.
00000090: 6bbe cb72 30e6 d83b 57bf 5c2a c907 1e77  k..r0..;W.\*...w
000000a0: 2fd9 f6eb 8b18 3361 ca8c 390b 96ac e8d9  /.....3a..9.....
000000b0: 3462 cc84 2933 e62c 940c 73c1 7af5 5c3b  4b..)3.,..s.z.\;
000000c0: 6b5c 5763 3338 ff45 e70f 7657 c799 8ff6  k\Wc38.E..vW....
000000d0: d8c0 f87b e3ae ab53 27ec e8f6 d5db 8c47  ...{...S'......G
000000e0: bd61 ee72 c967 d7af 5b99 b4a2 3259 c498  .a.r.g..[...2Y..
000000f0: 0953 66cc 59b0 6445 cfe6 1163 264c 9929  .Sf.Y.dE...c&L.)
00000100: 1956 4fad da7a 7782 32c6 8bce 2fe8 b6ae  .VO..zw.2.../...
00000110: f0ea 77f6 edba 73c5 7a7a 1acf e8b9 76a1  ..w...s.zz....v.
00000120: 67d7 3bce 7be7 76e7 354a e6ca e405 cbb0  g.;.{.v.5J......
00000130: 1f42 a940 9932 63ce 8225 2baa 5745 8c99  .B.@.2c..%+.WE..
00000140: 3065 c69c 8592 61cc fe19 b5a3 e64f 422b  0e....a......OB+
00000150: 84e9 ae0e ce6c 05f5 3459 faaa cc17 25bf  .....l..4Y....%.
00000160: 29a9 edb4 9eeb ef9c d770 7460 fcd1 3dee  )........pt`..=.
00000170: 5cfd 7065 c9fd e72d 5929 5355 6cd7 6b8b  \.pe...-Y)SUl.k.
00000180: a3ba 406d ce82 252b b61b e388 3113 a6cc  ..@m..%+....1...
00000190: 98b3 60c9 4ac9 30a9 ccea 8955 9f35 df6d  ..`.J.0....U.5.m
000001a0: 55c9 714d d654 1aed 2ba6 e4c2 3757 8d57  U.qM.T..+...7W.W
000001b0: 5d1d b30f 17dd 33a9 e782 3d3c ff43 6177  ].....3...=<.Caw
000001c0: 2ef5 ae2c d97a c692 43d7 fdcf 0f4f eb15  ...,.z..C....O..
000001d0: f3d4 1173 9f2f b7b1 8b88 3113 a6cc 98b3  ...s./....1.....
000001e0: 60c9 8a9e 2d23 c661 ff8a 795a 75fc 8e4d  `...-#.a..yZu..M
000001f0: eb23 2e9e 1bbf f7e1 3861 ab4f 39bf 7eea  .#......8a.O9.~.
00000200: c3fd f629 3fba fac5 7977 eeb8 3aff 3db4  ...)?...yw..:.=.
00000210: ae98 e739 36fc 35eb 695b 6f3b 66c2 9419  ...96.5.i[o;f...
00000220: 7316 2c59 d14f 208a 1833 617a f57a ea55  s.,Y.O ..3az.z.U
00000230: f7b5 b2ed 3782 7a9f 9c51 6c44 9331 8ebe  ....7.z..QlD.1..
00000240: 35ee 2af6 d526 777e 41d5 4525 e7ff af08  5.*..&w~A.E%....
00000250: 7bfc d020 dcf4 b900                      {.. ....

Try it online!
You can reverse this hexdump with xxd -r.
This is the result of Zopfliing the text 747 times in DEFLATE format.

Congratulations. You have just been outgolfed in Bubblegum.

And It'll not be easy to counter-outgolf because of the unwritten rules of PPCG.

@JanDvorak That means he had a solution ready and I outgolfed him, and then he used some billions of iterations, that's why it took so long.

GW-Basic, 598 bytes (tokenised file)
Unfortunately GW-Basic's text mode is limited to 80 columns. I tried squishing the table to make it fit, but that didn't look too pleasing so I had to use a graphical mode instead.
Below is the text source, with lines wrapped around at 80 columns for readability; take care that for the program to work it must be saved in code page 437. Should you try it out, you'll find it will flicker a lot while it's drawing. Sorry.
0 S$="+#zB¢0(Y%5k%2GkCUq*Y$ù╝%65SÅ.5H8ú¿ÅÅxIö}¥6Ç{NMLòΩ/ΘÉ}òY'=zI⌂úÅ8V├)û;tùU2δY
#EJ2$++£╪&Θ}óÉ{,ÇN7àmYƒ+7z)ÆH55<IPmTZ¥KÆûwyHS7┐₧óOk5╕æ┴âTtöPo2KWµÅ[╗%ú##mVWíkàƒ,
£q┘6▌òMso⌂/&#
1 SCREEN 9:DIM A%(169):L%=1:FOR R%=4 TO 314 STEP 35:FOR C%=4 TO 604 STEP 35:GOSU
B 3:IF K%GOTO 5ELSE GOSUB 3:C%=K%*35+C%:IF I%=118 THEN R%=R%+12
2 NEXT:NEXT:FOR R%=1 TO 3:LINE(109-(R%=3)*490,(R%=1)*82+330)-STEP(0,-68),0:FOR C
%=1 TO 3:LINE-STEP(6,12):LINE-STEP(-6,11):NEXT:LINE STEP(0,-35)-STEP(5,0),(R%AND
 1)*15:NEXT:LOCATE 23:END
3 IF L%<36 THEN B%=(ASC(S$)-35)*L%+B%:L%=L%*216:S$=MID$(S$,2)
4 K%=B%MOD 36:B%=B%\36:L%=L%\36:RETURN
5 SCREEN,,1:CLS:I%=ASC(MID$("`nn#r",INSTR("9YvG",CHR$(I%))+1))+I%-95:PRINT RIGHT
$(STR$(I%),3):PRINT" ";CHR$(K%+64);:GOSUB 3:PRINT CHR$((K%=0)*64+K%+96):GET(0,0)
-(23,27),A%:SCREEN,,0:PUT(C%+2,R%+5),A%:LINE(C%,R%)-STEP(35,35),,B:GOTO 2

GW-Basic doesn't save its files as efficiently as it could, so to get it down to 660 bytes you need to open the tokenised file in an editor and manually remove all the spaces but one, the end of file character and the garbage character before it. This will reduce its size to 660 bytes and it will still load and run just fine.
Edit: Since in this case it doesn't matter that the variables are integers, because the expected error is small and operations like MOD and \ round anyway, we might as well turn them into floating point variables, saving a % token on each mention. And I noticed the number 35 occurs often enough that the five bytes it takes to save it into a variable are (just!) worth it. If you've been keeping score, you'll have noticed we saved 43 bytes and the file system agrees: we're down to 617 bytes.
Edit: By slightly changing S$ I was able to shave off six more bytes: (K=0)*64+ became AND 127.
Edit: Okay, so I remembered I wanted to change the way I store empty areas. This shaved off seven more bytes, four in S$ and three more because GOSUB 3: was swapped out for >9. And I sacrificed some efficiency for another two bytes.
Edit: I broke through the 600 byte barrier! It's one thing to get something compact in a golfing language, but another thing to do it in a real-world language. And quite another thing yet if you manage it in GW-Basic of all things. S$ got five bytes bigger, but I saved nine bytes by replacing ASC(MID$(...))+I-95 with I+1 and adding IF K=1 ... ELSE on line 1.
0 S$="|R▐CñföfCσé╕»σε¡┤P╝l½║╙τ/a}µS╦┌]èp┼zµkµ\¢°┴+τ_╞E.₧í3?≥≈öéºµ9¬╚O?Ql'zç═┘E}ε
(ùRíHM4╥lΦ≥│6Æäb∞O@╗┘Z¿aú{2╚┤6╪╚M1cf▀ùütóQw»ùmÑíφÖ_0$kLô╩╣└u¥å█3Tìzæd±æñk)τW`╫≈å
¿b0sΓlqùV⌐█Ç8&
1 SCREEN 9:DIM A(180):L=1:W=35:FOR R=4 TO 314 STEP W:FOR C=4 TO 604 STEP W:GOSUB
 3:IF K=1 THEN GOSUB 3:I=K*2+57:C=C-WELSE IF K>9 GOTO 5ELSE C=K*W+C:IF I=118 THE
N R=R+12
2 NEXT:NEXT:FOR R=1 TO 3:LINE(109-(R=3)*490,(R=1)*82+330)-STEP(0,-68),0:FOR C=1
TO 3:LINE-STEP(6,12):LINE-STEP(-6,11):NEXT:LINE STEP(0,-W)-STEP(5,0),(R AND 1)*1
5:NEXT:LOCATE 23:END
3 IF L<36 THEN B=(ASC(S$)-W)*L+B:L=L*216:S$=MID$(S$,2)
4 K=B MOD 36:B=B\36:L=L\36:RETURN
5 SCREEN,,1:CLS:I=I+1:PRINT RIGHT$(STR$(I),3):PRINT" ";CHR$(K+55);:GOSUB 3:PRINT
 CHR$(K+96 AND 127):GET(0,0)-(W,W),A:SCREEN,,0:PUT(C+2,R+5),A:LINE(C,R)-STEP(W,W
),,B:GOTO 2

C (gcc), 623 610 bytes
#define E(a)s[x/18*3+a/7][x%18*6+a%7]
#define e(a,b,c)E(a)=E(b)=E(c)=
x;char*p="H HeLiBeB C N O F NeNaMgAlSiP S ClArK CaScTiV CrMnFeCoNiCuZnGaGeAsSeBrKrRbSrY ZrNbMoTcRuRhPdAgCdInSnSbTeI XeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW ReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaU NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg",s[999][110];P(x){e(14,28,42)47,e(7,21,35)92;}main(i){for(memset(s,32,4e3);*p;E(17)=*p++,E(18)=*p++,sprintf(&E(9)," %-2d "+i/100,i),s[i++][-1]=10,e(7,14,21)e(13,20,27)'|',x+=x?i-5&~8?i-58&~32?i-72&~32?1:-67:55:11:17)e(1,2,3)e(4,5,22)e(23,24,25)e(26,(i<6|E(0)&4),1)P(P(P(147)+1)+69)+3;puts(s);}

Try it online!
Thank gastropner for 2 bytes(and more the thought) and cailingcat for 7 bytes

You can save another two bytes by extending the e() macro. Link.

@ceilingcat s[x/18*3+i<5|E(0)&4/7][x%18*6+i<5|E(0)&4%7] seem don't have same meaning

Kotlin, 1688 1667 1664 bytes
Probably find some improvements to save bytes. But, got it working so I'm posting it. Thanks mazzy for 21 bytes declaring u. 3 more bytes removing template string and using u directly.
data class T(val n:String,val a:Int,val c:Int,val r:Int)
val n="H HeLiBeB C N O F NeNaMgAlSiP S ClArK CaScTiV CrMnFeCoNiCuZnGaGeAsSeBrKrRbSrY ZrNbMoTcRuRhPdAgCdInSnSbTeI XeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW ReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaU NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg"
val l=List(118){i->T(""+n[i*2]+n[i*2+1],i+1,when(i){0->1;1->18;2,3->i-1;in 4..9->i+9;10,11->i-9;in 12..17->i+1;in 18..35->i-17;in 36..53->i-35;in 54..56->i-53;in 57..70->i-53;in 71..85->i-67;in 86..88->i-85;in 89..102->i-85;else->i-99},when(i){0,1->1;in 2..9->2;in 10..17->3;in 18..35->4;in 36..53->5;in 57..70->8;in 54..85->6;in 89..102->9;else->7})}
val u="_____"
fun Int.c()={val t=this
when {t<10->"  $t  "
t<100->"  $t "
else->" $t "}}()
fun g(r:Int,c:Int)=l.find{t->t.r==r&&t.c==c}
fun b(r:Int,c:Int)={val e=g(r,c)
val n=g(r+1,c)
if(e==null)Array(3){if(c<2)if(n==null||it<2)"       "
else " $u "
else if(g(r,c+1)!=null)if(n==null||it<2)if(r>7&&c==3)if((r+it)%2<1)"     \\"
else "     /"
else "     |"
else "$u|"
else if(n==null||it<2)"      "
else if((r<2&&c>12)||(r==3&&c>2&&c<12))"_$u"
else "$u "}
else if(c<2)arrayOf("|${e.a.c()}|","|  ${e.n} |","|$u|")
else if(r==6&&c==3)arrayOf("${e.a.c()}\\","  ${e.n} /","$u\\")
else if(r==7&&c==3)arrayOf("${e.a.c()}/","  ${e.n} \\","$u/")
else if(r==8&&c==17)arrayOf("${e.a.c()}\\","  ${e.n} /","$u\\")
else if(r==9&&c==17)arrayOf("${e.a.c()}/","  ${e.n} \\","$u/")
else arrayOf("${e.a.c()}|","  ${e.n} |","$u|")}()
fun p()={val a=Array(30){""}
var s=1
for(r in 0..8){for(c in 1..18){val o=b(r+1,c)
for(i in 0..2)a[r*3+i+s]+=o[i]}
if(r==6)s+=2}
a[0]=" $u"+" ".repeat(97)+u
a[23]=" ".repeat(19)+"_".repeat(83)
a}()

Try it online!

great! you can save 16 bytes if: 1. insert val u="_____" before fun Int.c() and 2. replace all occurence of 5 underscore on $u. for example if((r<2&&c>12)||(r==3&&c>2&&c<12))"_$u"

@mazzy was 21 bytes. You likely missed two replacements. Thank you!

Bash + openssl + bzcat, 787 bytes
echo 'QlpoOTFBWSZTWU4gJ1IAAWJ/gCARACBAAP/gP+/f/r/v3yRAAlzt0bO4giaaJsgT
Uymg0PKAADRpoM00IVqnqhn7ypRAaBkAABpo0AACMqQHtU9QaPUDJoGjQAAAACJR
RlH6oAAAAA0AAANMSCuPE35BdLsIJgW7goiXLgTDCVQoiN8VkWiQG+IUghSAMiiV
iBIIJQbSowuqP1azrEUckcN2TFkgjzP/NbraQIlwhHiEQoAFArk2cXwzozZiX2Fd
oDTrgQ9SNYtUrT6Y12TdAzMzmiIiBMoAAqAEzeZmZlBVQAABV70RDMzM3olunLqr
w27cODVi7KDMVsJhVbEN5HVmxiudB3tlkdzOjK62bamumQDNHkDYZJRGomJuEzpZ
Rkq6q50aVleQn2z3xsGbI0K++++66664zM70REeHz9AsBWiIiMY1rWAI2Y8qqqqq
z1JAQlAhJJJJJQgsYwFUYilaqqrLEUu1AAGWIpcAVVGIpnmcqq3mIpdrIArLER43
K0Vta1rWVK2ta1rWtawomVEUy4ZkIUpUEVMfJWACgBXdpWALEFiAAgnr2YfmfRnx
Ec7MD/cMXEaMOGC9smHqfF4imuDpVNjBGUY5rRfAkIWsm1IbjdqdKLXLljKdUEfP
dKpdJ0ti+i6yMsj2u51K5QUACIYCI9AqBe9YKKRZEaxKQAJBaRJFaRSRlaDSEgkg
JIAOADHArBJJJEHCRUaMP8XckU4UJBOICdSA'|openssl enc -d -base64|bzcat

The newlines are required. Outputs the periodic table to stdout.

You can replace openssl enc -d -base64 with base64 -D

Powershell, bytes 1077 937 934 906 902 888 878 842 784 688 677 673 667 651 596 bytes
Port of Neil's Javascript
filter l{"{0,5}"-f("{0,-2} "-f$_)}filter m{"|$_|"}$z=(,(' '*95)*2+(($u='_'*5)+' '*61+'_'*29)+,(' '*59)*5+'_'*59|m)+,'|'*6+'\','/'*6
" $u"+' '*97+$u
-split"H,He
LiBe,BCNOFNe
NaMg,AlSiPSClAr
KCaSc,TiVCrMnFeCoNiCuZnGaGeAsSeBrKr
RbSrY,ZrNbMoTcRuRhPdAgCdInSnSbTeIXe
CsBaLa,CePrNdPmSmEuGdTbDyHoErTmYbLu,HfTaWReOsIrPtAuHgTlPbBiPoAtRn
FrRaAc,ThPaUNpPuAmCmBkCfEsFmMdNoLr,RfDbSgBhHsMtDsRgCnNhFlMcLvTsOg"|%{if(($b=$_-split','|%{(($s=$_-csplit'(.[a-z]?)'-ne'')|%{++$i|l}),($s|l),($s|%{$u})|%{$_-join'|'}})[8]){$a+=$b[3..5]}0..2|%{$b[$_]+$z[$j++]+$b[$_-3]}}|m
''
' '*18+'_'*84
$a|%{' '*18+($s=$z[$j++])+$_+$s}

Append rv i,j,a to the end of the script to able restart.
Ungolfed
# return formated label or number
filter l{"{0,5}"-f("{0,-2} "-f$_)}

filter m{"|$_|"}

# fillers
$z=(,(' '*95)*2+(($u='_'*5)+' '*61+'_'*29)+,(' '*59)*5+'_'*59|m)+,'|'*6+'\','/'*6

# output the periodic table rows
" $u"+' '*97+$u

# transform each label row to array of numbers, labels and separators
# insert a filler from $z[$j++] between first and last groups of 3 lines
# return 3 completed lines (left+filler+right)
# append middle group (Lanthanides and Actinides) to $a if the group is specified
-split"H,He
LiBe,BCNOFNe
NaMg,AlSiPSClAr
KCaSc,TiVCrMnFeCoNiCuZnGaGeAsSeBrKr
RbSrY,ZrNbMoTcRuRhPdAgCdInSnSbTeIXe
CsBaLa,CePrNdPmSmEuGdTbDyHoErTmYbLu,HfTaWReOsIrPtAuHgTlPbBiPoAtRn
FrRaAc,ThPaUNpPuAmCmBkCfEsFmMdNoLr,RfDbSgBhHsMtDsRgCnNhFlMcLvTsOg"|%{
    if(($b=$_-split','|%{
        (($s=$_-csplit'(.[a-z]?)'-ne'')|%{++$i|l}),
        ($s|l),
        ($s|%{$u})|%{
            $_-join'|'
        }
    })[8]){
        $a+=$b[3..5]
    }
    0..2|%{
        $b[$_]+$z[$j++]+$b[$_-3]
    }
}|m
''
' '*18+'_'*84
$a|%{' '*18+($s=$z[$j++])+$_+$s}

Retina, 888 bytes

 }~~xJ }¶|J1J|~~x>JwHJ|~~x{He@|}|}xJ q____|}w3j4J|x;j6j7j8j9j10 wLi{Be |x{BjCjNjOjFjNe@|}|}|x "w11{12 |x{13{14{15{16{17{18 wNa{Mg |x!l{Si:jSjCl!r@]qq____"w19>0>1>2>3>4>5>6>7>8>9-0-1-2-3-4-5-6 wKjCa{Sc{Ti{VjCr{Mn{Fe{Co{Ni{Cu{Zn{Ga{Ge!s{Se{Br{Kr@"""w37-8-9=0=1=2=3=4=5=6=7=8=9;0;1;2;3;4 wRb{Sr{YjZr{Nb{Mo{Tc{Ru{Rh:d!g{Cd{In{Sn{Sb{Te{IjXe@"""w55;6;7 \J72,3,4,5,6,7,8,9'0'1'2'3'4'5'6 wCs{Ba{La /JHf{Ta{WjRe{Os{Ir:t!u{Hg{Tl:b{Bi:o!t{Rn@]\Q|}w87'8'9 / 104&5&6&7&8&9%0%1%2%3%4%5%6%7%8 wFr{Ra!c \JRf{Db{Sg{Bh{Hs{Mt{Ds{Rg{Cn{Nh{Fl{Mc{Lv{Ts{Og@]/Q|}|¶¶~qqq}____ ¶~\J58;9<0<1<2<3<4<5<6<7<8<9,0,1 \¶~/JCe:r{Nd:m{Sm{Eu{Gd{Tb{Dy{Ho{Er{Tm{Yb{Lu /¶~\Q\¶~/J90#1#2#3#4#5#6#7#8#9&0&1&2&3 /¶~\JTh:a{UjNp:u!m{Cm{Bk{Cf{Es{Fm{Md{No{Lr \¶~/Q/
!
{A
"
]]
#
{9
%
z1
&
z0
'
{8
,
{7
-
{3
:
{P
;
{5
<
{6
=
{4
>
{2
@
 |¶
J

Q
}]]]]|}
j
 {
q
}}}}}
w
|¶|
x
~~~
z
 | 1
]
|}|}|}
{
 |
}
_____
~

Try it online!

C++, 866 bytes
#import<bits/stdc++.h>
#define S std::string
#define R .replace
#define F(a,b,c,d)for(a=b;a<c;a+=d)
#define G(b)F(i,b,31,1)
#define a A[i]
int i,j,t;main(){S*A=new S[31];G(0)a="|"+(i%3?S(108,32):S(107,95)+' ');A[0]R(6,95,95,32);A[6]=A[3]R(12,59,59,32);F(j,6,109,6)G(t=1)!t|A[i-1][j-1]^32?t=0,a[j]='|':0;G(22)a=' '+a.substr(0,i<24?j=0:85);F(i,1,31,3)for(t=0;~(t=a.find("|     |",t));j=j^56?j^88?j^117?j^70?j+1:89:57:103:71)A[i+1]R(t+3,2,"H HeLiBeB C N O F NeNaMgAlSiP S ClArK CaScTiV CrMnFeCoNiCuZnGaGeAsSeBrKrRbSrY ZrNbMoTcRuRhPdAgCdInSnSbTeI XeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW ReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaU NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg",j*2,2),a R(t+2,j>8?3:2,(j>98?"":" ")+std::to_string(j+1));G(25)a[1]=a[85]=A[i-9][18]=i&1?92:47;A[24]=" "+S(84,95);i=0;a[0]=a[101]=a[102]=A[3][71]=A[3][72]=A[6][71]=32;G(0)std::cout<<a<<'\n';}

Ungolfed version:
#include <bits/stdc++.h>

using namespace std;

string els = "H HeLiBeB C N O F NeNaMgAlSiP S ClArK CaScTiV CrMnFeCoNiCuZnGaGeAsSeBrKrRbSrY ZrNbMoTcRuRhPdAgCdInSnSbTeI XeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW ReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaU NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg";

int main()
{
    vector<string> ans(31, "|" + string(108, 32));
    for (int i = 0; i < 31; i += 3)
        ans[i] = "|" + string(107, 95)+' ';             // horizontal lines
    ans[0].replace(6,95,95,32);
    ans[3].replace(12,59,59,32);                        // clear some lines
    ans[6].replace(12,59,59,32);
    for (int i = 6; i <= 108; i += 6)
        for (int j = 1, t = 0; j < 31; j++)
            if (t|ans[j-1][i-1]!=32) t=1,ans[j][i]='|'; // vertical lines
    for (int i = 22; i < 31; i++)
        ans[i]=' '+ans[i].substr(0,i<24?0:85);          // remove cells between parts
    for (int i = 1, j = 0; i < 31; i += 3) {
        int t=0;
        while(~(t = ans[i].find("|     |",t))) {        // find a cell
            ans[i+1].replace(t+3,2,els,j*2,2);          // fill name
            ans[i].replace(t+2,j>8?3:2,(j>98?"":" ")+to_string(j+1)); // fill atomic number
            j=j^56?j^88?j^117?j^70?j+1:89:57:103:71;    // next cell
        }
    }
    for (int i = 25; i < 31; i++)
        ans[i][1]=ans[i][85]=ans[i-9][18]=i&1?92:47;    // wavy lines
    ans[24]=" "+string(84,95);                          // reset the first line of the second part
    ans[0][0]=ans[0][101]=ans[0][102]=ans[3][71]=ans[3][72]=ans[6][71]=32; // minor edits
    for (auto i : ans) cout << i << endl;
}

Python 3, 730 bytes
import lzma,base64
print(lzma.decompress(base64.b85decode("T>t=p0RR90|NsC0{{Rpd@Pr$w-*8%~!=Rn5Pm7UVqBC5v9Zg6LfW&}*+O=ziY>}RL7H;N`68rv%5rHo*1j;XROG{S~5LdQ~BFg$x8B^QtOzAFAZjB>8=k@=h&&c?Q%F3xURR*-Pndp~Y0zlY74sr-TW3Zd)nAM>*=A(x|SBB$&#S+q%k6Dq;D5iDORZn`cx|)ahM*kG8f5J9tFU28-&|-&$rKujnI$Ct|5lxHm7Q;d|EFM&p&cfr+mrOgvg-2PXY}<0hm!sCs+~MJ}+AvfKubl|YMYol-0O|xBfr`s~?3$-5CZy*nbw@cugNQWVmvNd#ZT{u(L~~hJc-?0{ShpeGgVr3#H{G6K{s~IBGOnI2*NvtpbvD{0-OTPLa@;13xt#)GYNyC>Aagh~S@aj6;Cx*hHbhQL#8xCP!axutBybVK3MJn?r54EAMdD{py(_#s<OTbPJ`CeF5l=^KQ|FT!H&DuDv(8G#b+7E%t?!pfko{I5?i#LfmYI&qA`eBz%_VAZqq{kpF{BJ@ZtLMk$_AC?xs#r8lUGZMw;EEPQysR|;q)X{OvS-fq7&&EWhn@Af`pVXR_j#&YAB!kx3|rr;BkcHP({82nUY&)kTq~vZ$bHSbbL*b+}RG!)Zj5U)<1e8727+LBCTn55Y>!3TR;5@SMv")).decode())

844 bytes

///, 987 958 bytes
/J/\/\///í/				Jù/____Jú/
x\\Jà/z1Já/\/!JQ/q
J	/ :Jj/  Jq/ |Jx/$^^Jw/$$$$Jz/ | J:/ù_J;áTJ~áSJ`áRJ-áLJ+áHJ=áBJ?áAJ>áNJ<áPJ.áFJ,áMJ"áCJ'á9J]á8J[á7J}á6J{á5J)á4J(á3J*á2J&á1J^/    J%/@@@@@@J$/  ^^J#/|  J@/ù_|/á/ |  /	ww$^j
#1 !ww$j* Q#H !ww$j+eQ|@:w$$	:::ù@@
#3 ) !w$^j{ } [ ] ' &0Q#Li=e!w$^j= " > !O . >eQ|@@wxq%
#11&2!w$^j&3&4&5&6&7&8Q#Na,g!w$^j?l~i< ~ "l?rQ|@@::::::::::ù%@
#19*/§/0*1*2*3*4*5*6*7*8*9/§(0(1(2(3(4(5(6Q#K "a~c;i!V "r,n.e"o>i"u!Zn!Ga!Ge?s~e=r!KrQ|%%%
#37(8(9)/*/)/§{0{1{2{3{4Q#Rb~r!Y !Zr>b,o;c`u`h<d?g"d!In~n~b;e!I !XeQ|%%%
#55{6{7 \\j72[3[4[5[6[7[8[9]0]1]2]3]4]5]6Q#Cs=a-a \/jHf;a!W `e!Os!Ir<t?u+g;l<b=i<o?t`nQ|@@:\\%%@@@
#87]8]9 \/ 104à05à06à07à08à09à10à11à12à13à14à15à16à17à18Q#Fr`a?c \\jRf!Db~g=h+s,t!Ds`g"n>h.l,c-v;s!OgQ|@@:\/%%@@@

x:_ííí	ú\j58{9}/*/}/§[0[1 \\ú/jCe<r>d<m~m!Eu!Gd;b!Dy+o!Er;m!Yb-u \/ú\%%@:\\ú/j9/*/'/§à00à01à02à03 \/ú\jTh<a!U >p<u?m"m=k"f!Es.m,d>o-r \\ú/%%@:\/

Try it online!
I tried

Canvas, 289 bytes
ø“^,＞ø0ｐk↶┘？6－ｗF－ｃ⁶DI2Ｅr„‾⁴┬３ｎ０Ｘ｛┤Ｙ┘┘｛┐┌ω＋┤６×ｙ３× ３_×＋|２＊∔┼（ｖ：“ko±╫ＪＨ(:)⇵↙↕ｌ╷-Ｎ6 ↶±A)！|¾ｂｋｉ＃ＬＯiＣ０÷１c─↔k⁵IＹｈ╬%÷╶１B－-uｌ＠%Ａ%⁵KＵ/iＥ╷＠Ｌ0≤｝ｎＪＤ«↑７Ｅ;ｐMＪ2↓Zx^９{t９╴Y０[9◂ ?↙ø╬０N４＠⇵║ＭXh＃Ｈ«；g→zc-X８4］Fk`⁸OＯ^»^Ｌ]U４Ｚ¼e＼０w┤∙ｐjｐ8←|═９±±→╵Mｔ⁵L@|Oｎ !±ｂ⁹2R⁰‟２ｎ├＠ ４×）ｒ３２╋∙╋｝｝“５７ｑ‼(„‾;┬３ｎ｛┤_×╋｝“¾├W↓5„‾X┬２ｎ｛┤/\３×↷╋

Try it here!

Python 3, 815 768 bytes
q=range
u,*D='_'
I={(24,18):u}
for c in q(102):I[(c<73)*6+3,c]=u
i=r=c=0
for Z in('1,c=102,1,,'+'2,c=72,6,,'*2+'18,,'*2+'3,r=%d,14,r=%d,c=18,15,,'*2%(24,15,27,18)).split(','):
 if'1'>Z:r+=3;c=0
 elif'a'>Z:
  for _ in q(int(Z)):D+=[(r,c)];c+=6
 exec(Z)
for R,C in D:
 for X in u*5,str(i+1),'H HeLiBeB C N O F NeNaMgAlSiP S ClArK CaScTiV CrMnFeCoNiCuZnGaGeAsSeBrKrRbSrY ZrNbMoTcRuRhPdAgCdInSnSbTeI XeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW ReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaU NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg'[2*i:][:2],u*6:
  c=C+1
  for z in X.center(5):I[R,c]=z;c+=1
  if'_'*5!=X:I[R,C]=I[R,C+6]='|'
  R+=1
 i+=1
for r,c in(16,18),(25,18),(25,102):
 for i in q(6):I[r+i,c]='\\/'[i%2]
for r in q(31):print(*(I.get((r,c),' ')for c in q(109)),sep='')

Try it online!
I particularly like  the magic string 1,c=102,... encoding the layout of the table.
Commented:
q=range
u,*D='_'

# I is an ascii art "canvas". I[y,x] = character at that location
I={(24,18):u}

# Draw (into I) top lines
for c in q(102):I[(c<73)*6+3,c]=u

i=r=c=0

# Read a magic string '1,c=102...' to construct D.
#
# After the loop, D = [(0, 0), (0, 102), (3, 0), (3, 6), (3, 72), ...]
#
# The i'th item in D gives the y,x coordinates of the top-left corner of the
# i'th element:
#
# [(0, 0), (0, 102), (3, 0), (3, 6), (3, 72), ...]
#  H       He        Li      Be      B
for Z in('1,c=102,1,,'+'2,c=72,6,,'*2+'18,,'*2+'3,r=%d,14,r=%d,c=18,15,,'*2%(24,15,27,18)).split(','):
    if'1'>Z:r+=3;c=0
    elif'a'>Z:
        for _ in q(int(Z)):D+=[(r,c)];c+=6
    exec(Z)

# Draw (into I) the table, excluding slashes
for R,C in D:
    for X in [
         u*5,       # Draw horizontal line (top)
         str(i+1),  # Draw atomic number
         # Draw element symbol
         'H HeLiBeB C N O F NeNaMgAlSiP S ClArK CaScTiV CrMnFeCoNiCuZnGaGeAsSeBrKrRbSrY ZrNbMoTcRuRhPdAgCdInSnSbTeI XeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW ReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaU NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg'[2*i:][:2],
         u*6        # Draw horizontal line (bottom)
    ]:
        c=C+1
        for z in X.center(5):I[R,c]=z;c+=1
        if'_'*5!=X:I[R,C]=I[R,C+6]='|'  # Draw vertical lines
        R+=1
    i+=1

# Draw (into I) the slashes
for r,c in(16,18),(25,18),(25,102):
    for i in q(6):I[r+i,c]='\\/'[i%2]

# Print the canvas
for r in q(31):print(*(I.get((r,c),' ')for c in q(109)),sep='')
```

Python 3.8 (pre-release), 699 bytes
U,S,P,*I='_ |'
Q=range
i=0
for N in[2,8,8,18,18,32,32]:
 A,B,*C=[],[],;I+=A,B,C
 for _ in Q(N):B+=P,'H HeLiBeB C N O F NeNaMgAlSiP S ClArK CaScTiV CrMnFeCoNiCuZnGaGeAsSeBrKrRbSrY ZrNbMoTcRuRhPdAgCdInSnSbTeI XeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaW ReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaU NpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg'[2*i:][:2].center(5);A+=P,str(i:=i+1).center(5);C+=P,U*5
for i in Q(3):I[i][2:2]=[P+S*95]
for i in Q(3,9):I[i][4:4]=[P+[U,S][i<8]*59]
I+=[S*1+U*84],
for i in Q(15,21):I+=[[S]+I[i][6:34]];I[i][6:34]=[]
I[2][2]=P+U*5+S*61+U*29
for r in I:r+=P
I[21][-1]=''
for r,R in zip(I[15:21],I[22:]):r[6]=R[1]=R[-1]='\\/'[i%2];i+=1
for r in[S+U*5+S*97+U*5]+I:print(*r,sep='')

Try it online!
Shortest Python solution! Used a similar approach to the Ruby solution by Lever River St. The first loop generates this output and the rest rearranges it and adds the missing lines and slashes.
|  1  |  2
|  H  |  He
|_____|_____
|  3  |  4  |  5  |  6  |  7  |  8  |  9  |  10
|  Li |  Be |  B  |  C  |  N  |  O  |  F  |  Ne
|_____|_____|_____|_____|_____|_____|_____|_____
|  11 |  12 |  13 |  14 |  15 |  16 |  17 |  18
|  Na |  Mg |  Al |  Si |  P  |  S  |  Cl |  Ar
|_____|_____|_____|_____|_____|_____|_____|_____
|  19 |  20 |  21 |  22 |  23 |  24 |  25 |  26 |  27 |  28 |  29 |  30 |  31 |  32 |  33 |  34 |  35 |  36
|  K  |  Ca |  Sc |  Ti |  V  |  Cr |  Mn |  Fe |  Co |  Ni |  Cu |  Zn |  Ga |  Ge |  As |  Se |  Br |  Kr
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____
|  37 |  38 |  39 |  40 |  41 |  42 |  43 |  44 |  45 |  46 |  47 |  48 |  49 |  50 |  51 |  52 |  53 |  54
|  Rb |  Sr |  Y  |  Zr |  Nb |  Mo |  Tc |  Ru |  Rh |  Pd |  Ag |  Cd |  In |  Sn |  Sb |  Te |  I  |  Xe
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____
|  55 |  56 |  57 |  58 |  59 |  60 |  61 |  62 |  63 |  64 |  65 |  66 |  67 |  68 |  69 |  70 |  71 |  72 |  73 |  74 |  75 |  76 |  77 |  78 |  79 |  80 |  81 |  82 |  83 |  84 |  85 |  86
|  Cs |  Ba |  La |  Ce |  Pr |  Nd |  Pm |  Sm |  Eu |  Gd |  Tb |  Dy |  Ho |  Er |  Tm |  Yb |  Lu |  Hf |  Ta |  W  |  Re |  Os |  Ir |  Pt |  Au |  Hg |  Tl |  Pb |  Bi |  Po |  At |  Rn
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____
|  87 |  88 |  89 |  90 |  91 |  92 |  93 |  94 |  95 |  96 |  97 |  98 |  99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118
|  Fr |  Ra |  Ac |  Th |  Pa |  U  |  Np |  Pu |  Am |  Cm |  Bk |  Cf |  Es |  Fm |  Md |  No |  Lr |  Rf |  Db |  Sg |  Bh |  Hs |  Mt |  Ds |  Rg |  Cn |  Nh |  Fl |  Mc |  Lv |  Ts |  Og
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____

authors: Евгений Новиков


text:
Palindromic Residue
Today, as I'm writing this, is March 31st. In the US, this is 3/31. I was playing around with 331 as a number to come up with a challenge, and found that its residues (modulo small numbers) is palindromic. 331%2=1, 331%3=1, 331%4=3, 331%5=1, 331%6=1 (11311).
Your challenge here is, when given an integer n > 2, output the first n positive numbers that have palindromic residue when taken modulo [2,n].
For example, for input 7, the output should be 1, 42, 43, 140, 182, 420, 421. Here's the chart explaining why that's the case:
        mod
num | 2 3 4 5 6 7
-----------------
  1 | 1 1 1 1 1 1
 42 | 0 0 2 2 0 0
 43 | 1 1 3 3 1 1
140 | 0 2 0 0 2 0
182 | 0 2 2 2 2 0
420 | 0 0 0 0 0 0
421 | 1 1 1 1 1 1

Input
A single positive integer n with n > 2 in any convenient format.
Output
The resulting array/list of the first n palindromic residues, as outlined above. Again, in any suitable format.
Rules

For n > 10, assume the residue list to be flattened before checking whether it's a palindrome. That is, [1, 10, 11] is palindromic, but [1, 10, 1] is not.
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
If possible, please include a link to an online testing environment so other people can try out your code!
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Examples
[input]
[output]

3
[1, 6, 7]

4
[1, 4, 5, 8]

5
[1, 50, 60, 61, 110]

6
[1, 30, 31, 60, 61, 90]

7
[1, 42, 43, 140, 182, 420, 421]

8
[1, 168, 169, 336, 337, 504, 505, 672]

9
[1, 2520, 2521, 5040, 5041, 7560, 7561, 10080, 10081]

10
[1, 280, 281, 560, 1611, 1890, 1891, 2170, 2171, 2241]

11
[1, 22682, 27720, 27721, 50402, 55440, 55441, 78122, 83160, 83161, 105842]

Is the output supposed to be ordered?

@Arnauld It doesn't need to be, no, provided that it includes only the first n elements.

arrgh ... your challenge = your rules, but "[1, 10, 11] is palindromic, but [1, 10, 1] is not" seems so mathematically wrong.

@GregMartin Stringy palindromes, not mathy palindromes. ;-)

Can you add a test case that makes use of the n>10 flattening behaviour?

@math_junkie I don't have a full test case, but for an example, 15 has this happen when it gets to 1041040 -- the residues are 0 1 0 0 4 0 0 1 0 0 4 0 0 10.

grr. The whole stringy instead of mathy palindrome makes this a thousand times harder in certain languages. Oh well.

Haskell, 57 bytes
f n=take n[x|x<-[1..],(==)=<<reverse$show.mod x=<<[2..n]]

Usage example: f 4 -> [1,4,5,8]. Try it online!
The first =<< is in function context and translates to the lambda \x -> reverse x == x and the second =<< is in list context and equivalent to concatMap, i.e. map-and-flatten-one-list-level.

05AB1E, 12 bytes
µN2¹Ÿ%JÂQD½–

Try it online!
Explanation
µ              # until counter equals input do:
 N             # push current iterations number
     %         # modulus each in
  2¹Ÿ          # range [2 ... input]
      J        # joined to string
       ÂQ      # equals it's reverse
         D     # duplicate
          ½    # if true, increase counter
           –   # if true print iteration number

Do you post 05AB1E answers from your phone? Cause you do these quick lol.

@carusocomputing: Very seldom as a lot of the characters in cp-1252 are annoying to type/copy-paste on the phone. This one popped up right before I checked my computer after dinner, so I had pretty good timing :)

Mathematica, 79 bytes
NestList[#+1//.x_/;!PalindromeQ[ToString/@Mod[x,Range@n+1]<>""]:>x+1&,1,n=#-1]&

Python 2, 98 97 bytes
n=input();i=j=0
while i<n:
 j+=1;l=''
 for k in range(2,n+1):l+=`j%k`
 if l==l[::-1]:i+=1;print j

Try it Online!

you can drop the entire string conversion

@Rod Thanks, but I believe that would fail on input 12 due to the strange rule that [1, 10, 11] is considered a palindrome

JavaScript (ES6), 104 bytes
f=(n,x=(k=--n,2))=>k?([...Array(n)].map(_=>(r=x%++i+r,x%i),i=1,r='').join``==r?k--&&x+' ':'')+f(n,x+1):1

Demo
NB: Because of the numerous recursive calls, this will crash for n > 8 on Firefox or n > 10 on Chrome.

f=(n,x=(k=--n,2))=>k?([...Array(n)].map(_=>(r=x%++i+r,x%i),i=1,r='').join``==r?k--&&x+' ':'')+f(n,x+1):1

for(n = 2; n < 9; n++) {
  console.log(n, '=>', f(n));
}

Scala, 90 86 82 bytes
(n:Int)=>Stream.from(1)filter{i=>val d=(2 to n)map(i%)mkString;d.reverse==d}take(n)

Explanation
Stream.from(1)                              // From an infinite Stream starting from 1,
    filter ( i => {                         // keep only elements matching the next condition :
        val d=(2 to n)map(i%)mkString;      // Generate residues and convert to String,
        d.reverse==d                        // return true if palindrom, false otherwise
    })take(n)                               // Finally, take the n first elements matching the condition

Test cases
val f = (n:Int)=>...    // assign function
(3 to 11).foreach { i =>
    println(i + "\n" + f(i).mkString(", ") + "\n")
}

Results
3
1, 6, 7

4
1, 4, 5, 8

5
1, 50, 60, 61, 110

6
1, 30, 31, 60, 61, 90

7
1, 42, 43, 140, 182, 420, 421

8
1, 168, 169, 336, 337, 504, 505, 672

9
1, 2520, 2521, 5040, 5041, 7560, 7561, 10080, 10081

10
1, 280, 281, 560, 1611, 1890, 1891, 2170, 2171, 2241

11
1, 22682, 27720, 27721, 50402, 55440, 55441, 78122, 83160, 83161, 105842

Edits
#1 (90 => 86)

anonymous function

#2 (86 => 82)

remove useless dot characters after parenthesis or bracket (ex. : (2 to n).map(%i) => (2 to n)map(%i)

Welcome to PPCG!

Thanks! I was wondering if I could change def f(n:Int)= to (n:Int)=>, since it also defines a function (but without name). It saves 4 bytes !

Yes, unnamed functions are allowed, provided you don't need the name for a recursive call or something like that.

Great, edited :)

MATL, 19 bytes
Thanks to @AdmBorkBork for pointing out a mistake in an earlier version of the code, now corrected
`@Gq:Q\VXztP=?@]NG<

Try it online!
Explanation
`        % Do...while
  @      %   Push iteration index, starting at 1
  Gq:Q   %   Push [2 3 ... n], where n is the input
  \      %   Modulo, element-wise
  V      %   Convert to string. Numbers are separated by spaces
  Xz     %   Remove spaces
  tP     %   Duplicate, flip
  =      %   Equal? (element-wise)
  ?      %   If all results were true
    @    %     Push current iteration index. It is one of the sought numbers
  ]      %   End
  N      %   Push number of elements in stack
  G      %   Push input n
  <      %   Less than? This is the loop condition
         % End (implicit). Display (implicit)

Jelly, 12 bytes
%Ð€ḊDFŒḂ
1ç#

How?
1ç# - Main link: n
1   - initialise "i" at 1
  # - increment i and yield a list of the first n truthful results of:
 ç  -     last link (1) as a dyad

%Ð€ḊDFŒḂ - Link 1, test a value "i" for mod [2,n] being palindromic: i, n
 Ð€      - for each, mapped over the right argument, i.e. for j = 1 to n:
%        -     i modulo j
   Ḋ     - dequeue, i.e. discard the modulo 1 result
    D    - convert to decimal list (vectorises)
     F   - flatten into one list
      ŒḂ - is palindromic?

Try it online!

QBIC, 48 bytes
:{A=G[2,a|A=A+!q%b$]~A=_fA||h=h+1?q]q=q+1~h=a|_X

Beats Mathematica! Sample run:
Command line: 10
 1
 280
 281
 560
 1611
 1890
 1891
 2170
 2171
 2241

Explanation:
:{          Get 'a' from the command line, start an inf. loop
A=G         Clear out whatever's in A$
[2,a|       For each of the numbers we want to modulo
A=A+        Add to A$
     q%b       our current number MODULO te loop iterator
    !   $      cast to string
]           NEXT
~A=_fA|     If the string of remainders is a palindrome (_f ... | is Reverse())
|h=h+1      THEN h=h+1 (h starts at 0) - this counts how many hits we've had
 ?q            also, print the number with the palindromic remainder
]           END IF
q=q+1       Test the next number
~h=a|_X     If we've had 'a' hits, quit.
            The last IF and the infinite loop are closed implicitly.

Japt, 26 bytes
L³o fR{C=Uò2@R%XÃ¬ ¥CwÃj1U

Try it online! Takes a few seconds on all inputs, so be patient please.
This would be considerably shorter (and faster) if there were a built-in to get the first N numbers satisfying some condition:
R{C=Uò2@R%XÃ¬ ¥Cw}aU

PHP, 93 Bytes
for(;$x<$a=$argn;$s="")for($i=1,++$n;$i++<$a;)if($i==$a&strrev($s.=$n%$i)==$s)echo$n._.!++$x;

Online Version 2 Loops Output as string
Expanded
for(;$x<$a=$argn;$s="")
for($i=1,++$n;$i++<$a;)
    if($i==$a&strrev($s.=$n%$i)==$s)echo$n._.!++$x;

PHP 130 Bytes
for(;count($r)<$a=$argn;$s=[])for($i=1,++$n;$i++<$a;){$s[]=$n%$i;if(count($s)==$a-1&strrev($j=join($s))==$j)$r[]=$n; }print_r($r);

Online Version 2 Loops
Expanded
for(;count($r)<$a=$argn;$s=[])
for($i=1,++$n;$i++<$a;){
    $s[]=$n%$i;
    if(count($s)==$a-1&strrev($j=join($s))==$j)$r[]=$n;
}
print_r($r);

PHP, 139 Bytes with 1 loop
for($i=$n=1;count($r)<($a=$argn)&$i++<$a;){$s[]=$n%$i;if(count($s)==$a-1){if(strrev($j=join($s))==$j)$r[]=$n;$n++;$s=[];$i=1;}}print_r($r);

Online Version 1 Loop
Run with
echo '<string>' | php -nR '<code>'

Expanded
for($i=$n=1;count($r)<($a=$argn)&$i++<$a;){
    $s[]=$n%$i;
    if(count($s)==$a-1){
        if(strrev($j=join($s))==$j)$r[]=$n;
        $n++;
        $s=[];
        $i=1;
    }
}
print_r($r);

CJam, 28 bytes
0ri:N{{)_N),2>f%s_W%#}g_p}*;

Try it online!
Explanation
0          e# Push 0, the value we'll repeatedly increment to search for valid outputs.
ri:N       e# Read input, convert to integer, store in N.
{          e# Run this block N times...
  {        e#   Run this block until the condition is true, which will find the next
           e#   number with palindromic residues...
    )_     e#     Increment and duplicate.
    N),2>  e#     Push [2 3 ... N].
    f%     e#     Take the current value modulo each of these.
    s      e#     Flatten them into a single string.
    _W%    e#     Duplicate and reverse.
    #      e#     Try to find the reverse in the original. A common way to compute
           e#     "not equal" for strings of the same length.
  }g
  _p       e#   Print a copy of the result.
}*
;          e# Discard the final result to prevent printing it twice.

Jelly, 8 bytes
1%ⱮḊŒḂɗ#

Try it online!
How it works
1%ⱮḊŒḂɗ# - Main link. Takes n on the left
1        - Set the return value to 1
       # - Count up i = 1, 2, ..., and return the first n which return true:
      ɗ  -   Combine the previous three links into a dyad
             with i on the left and n on the right:
  Ɱ      -     For each integer m in 1, 2, ..., n:
 %       -       i % m
   Ḋ     -     Remove i % 1
    ŒḂ   -     Is palindromic?

Japt, 13 bytes
@õ!uX ÅêS}jU1

Try it or run all test cases
@õ!uX ÅêS}jU1     :Implicit input of integer U
@                 :Function taking an integer X as argument
 õ                :  Range [1,U]
  !uX             :  Mod X by each
      Å           :  Slice off the first
       êS         :  Is palindrome?
         }        :End function
          jU1     :Starting with 1, return the first U integers that return true

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Make me a pizza
Because it's Saturday (UTC) and I'm hungry, I would like a slice of pizza. I will give you an order and I would like a nice hot ascii-art pizza. Up to the challenge?
The Drive-Thru
I'll place my order wherever your drive-thru is, whether it is STDIN, a function parameter, a command-line argument, but I'm not going to put it in a variable for you. (JS function expressions must be assigned to a variable.)
The order
My order will have 2 parts. The first will be a positive, non-zero integer from 3 to 6. This is the size of my pizza. For instance, a size 6 pizza with no toppings would look like:
 /=====\
/       \
|       |
|       |
\       /
 \=====/

A size 5:
 /====\
/      \
|      |
\      /
 \====/

A size 4:
 /===\
|     |
|     |
 \===/

A size 3
 /==\
|    |
 \==/

The toppings
My toppings will be a string of UPPERCASE letters. Here are the possible values:

P - Pepperoni
S - Sausage
N - piNeapple
J - Jalapenos
B - Banana peppers
C - baCon

You must fit them on the pizza somewhere. If I order a size 4 and PSPCJ, then this is a valid output:
 /===\
|PSPCJ|
|     |
 \===/

So is this:
 /===\
|P P J|
| S C |
 \===/

And this:
 /===\
|     |
|PSPCJ|
 \===/

I am not really picky about where my toppings are on the pizza, as long as they aren't on the crust or on top of each other.
The pick-up window
I will go to a lot of places to pick up my pizza, including STDOUT, a file, the return value of a function, but not a variable.
Extra stuff

Standard loopholes forbidden
This is tagged code-golf so the shortest answer in bytes wins!
Don't worry about invalid input (toppings > pizza space, etc.)
See my answer (JS ES6) below for an example (I hope you can do better)

Umm, So you can also pick your pizza up on a Drive-thru?

Are you picky about me filling the top right and bottom right corners of the pizza box with whitespace? ;)

@DLosc no, any trailing whitespace at the end of any line (including a trailing newline at the end of output) is optional but not required.

C̶a̶n̶ ̶t̶h̶e̶ ̶p̶i̶z̶z̶a̶ ̶h̶a̶v̶e̶ ̶m̶o̶r̶e̶ ̶t̶h̶a̶n̶ ̶o̶n̶e̶ ̶f̶o̶r̶ ̶o̶n̶e̶ ̶o̶f̶ ̶t̶h̶e̶ ̶t̶o̶p̶p̶i̶n̶g̶s̶?̶ ̶S̶o̶ ̶i̶f̶ ̶y̶o̶u̶ ̶l̶i̶k̶e̶ ̶p̶i̶n̶e̶a̶p̶p̶l̶e̶:̶ ̶̶5̶,̶ ̶N̶N̶N̶̶ ̶i̶s̶ ̶a̶l̶s̶o̶ ̶a̶ ̶v̶a̶l̶i̶d̶ ̶i̶n̶p̶u̶t̶ ̶(̶o̶r̶ ̶s̶h̶o̶u̶l̶d̶ ̶i̶t̶ ̶b̶e̶ ̶̶5̶,̶ ̶N̶̶ ̶i̶n̶s̶t̶e̶a̶d̶)̶?̶ Also, where are the mushrooms?.. :( EDIT: Nevermind about the first question, I see your test cases has 2x P.

Can I post an orderup link? xD

Pip, 87 81 75 bytes
74 bytes of code, +1 for -l flag.
e:'/.'=Xa-1.'\Y['/'\]Xa//5J'|X2-a%2^xPs.ePy.(b.sXa*a-a-2-#b<>a+1).RVys.RVe

Takes input as command-line arguments. Try it online!
Approach
e is the top row, such as /=====\. If you reverse it, it's also the bottom row.
y is the left border, such as ["/" "|" "|" "\"]. If you reverse it, it's also the right border.
We then construct the middle by taking b, the toppings, padding it with spaces to length (a+1)*(a-2) (where a is the size), and grouping it into a list of rows.
Finally, we print the top row with a leading space; concatenate the middle between y on the left and RVy on the right, and print that; and print the bottom row with a leading space.

Does this work with a cheese (no toppings) pizza?

@programmer5000 Yes--in that case the second cmdline arg should be an empty string (if you're running it from an actual command-line, you'll have to quote it).

Python 2, 202,198,190,177,162,157,146 bytes
n,t=input()
y=n+1
s=' '
l=' /'+'='*(n-1)+'\\ '+('','\n/'+s*y+'\\')[n>4]+'\n|'
print l+t[:y].center(y,s)+('','|\n|'+t[y:].center(y,s))[y%2]+l[::-1]

Try it online!

Hey, can you assign '\\', '|', and '/ to variables to golf off a few bytes? That's how I shaved a lot off my JS answer.

I'm just working on that!!!!

Also, can you replace the first (n-1) with (--n), the n>4s withn>3, (n+1) with (n+2), and the final (n-1) with n to shave off 4 bytes?

python doesnt support -- operator !

136 bytes

Python 3, 224 213 195 bytes
n,t=eval(input())
k=n+1
y=print
i=0
f,s,e,b,p="/ =\\|"
t+=s*99
y(s+f+e*~-n+b)
if n>4:y(f+t[:k]+b);i+=k
y(p+t[i:i+k]+p);i+=k
if~-n%2:y(p+t[i:i+k]+p);i+=k
if n>4:y(b+t[i:i+k]+f);i+=k
y(s+b+e*~-n+f)

Try it online!

Charcoal, 37 bytes
Ｎθ /==×=⸿/›θ⁴⸿|‖ＢＯ↓﹪θ²‖ＢＯ⊕﹪θ²Ｊ¹¦¹⪪Ｓ⊕θ

Try it online! Link is to verbose version of code. Explanation:
Ｎθ

Input the size of the pizza.
 /==

Start printing the top of the pizza.
×=⸿/›θ⁴

If the pizza is one of the larger sizes, add extra to the top and side.
⸿|

Print more of the side of the pizza.
‖ＢＯ↓﹪θ²

Complete the left half of the pizza by reflection with possible overlap.
‖ＢＯ⊕﹪θ²

Complete the pizza by reflection with variable overlap.
Ｊ¹¦¹⪪Ｓ⊕θ

Input the toppings and split them into pieces so they will fit inside the pizza.

JS (ES6), 257 255 249 248 246 244 bytes
m=s=>t=>(r="/",k="\\",p=" ",f="\n",x="|",c=f+x,q="",t=p+t,z=(s>2?p:q)+r+"=".repeat(s-1)+k+(s>4?f+r+p.repeat(++s)+k:q)+c+p.repeat(s)+x+(!s?c+p.repeat(s)+x:q)+p+(s>5?f+k+p.repeat(s)+r:q)+f+p+k+"=".repeat(s-2)+r,i=-1,z.replace(/ /g, x=>t[++i]||p))

Call it like m(4)("PS") for 1 pepperoni and 1 sausage. Probably can be golfed more.

Jeez, give some other people time to answer :P

@Григорий Перельман I just wanted to provide an example, I hope this doesn't win.

JavaScript (ES6), 170 161 bytes
(n,t,a=[1,,n%2||2,,1])=>` /=\\
/___\\
|___|
\\___/
 \\=/`[r=`replace`](/.+/g,s=>s.repeat(a.pop()||n>4))[r](/=|_\b/g,`$&`.repeat(n-1))[r](/_/g,_=>t[i++]||` `,i=0)

Starts by taking a misshapen pizza of width 2 and height 5 and stretches it horizontally and adjusts it vertically as appropriate, then replaces the interior with toppings or spaces once they run out.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
What are my chess moves?
Chess is a game with 6 different types of pieces that can move in different ways:

Pawns - They can only move up or capture diagonally (also forward). Capturing a piece behind them or beside them is illegal. The only exception is en passant. For this challenge, if  a pawn reaches the 8th rank (or row), assume it becomes a queen.
Bishops - They move diagonally and the squares they travel on will always have the same color (i.e if the square the bishop is currently on is white, the bishop can't move to a darker square for  instance).
Knights - They move pretty awkwardly. They can move two spaces up/down then one space to the right/left or two spaces right/left then on space up/down.
Rooks - They can only move in straight lines, up or down or left or right.
Queens - They can move diagonally like a bishop or in straight lines like a rook
Kings - They can only move to squares they are touching (including diagonals).

This chess.com link to clarify the above. A chessboard and its coordinates are shown below:

So given an entirely empty chessboard except for one piece and the inputs -- the piece's type and its current position, what are the piece's legal moves?
Examples
Input: Rook a8
Output: a1 a2 a3 a4 a5 a6 a7 b8 c8 d8 e8 f8 g8 h8

Input: Pawn a2
Output: a4 a3

Input: Pawn a3
Output: a4

Input: Knight a1
Output: c2 b3

Input: Bishop h1
Output: a8 b7 c6 d5 e4 f3 g2

Input: King b2
Output: c2 c3 c1 b3 b1 a1 a2 a3

Input: Queen h1
Output: a8 b7 c6 d5 e4 f3 g2 h2 h3 h4 h5 h6 h7 h8 a1 b1 c2 d1 e1 f1 g1

Rules and Specifications

A legal move is defined as a move in which the piece can go to while being on the board. So a rook at a1 can go to a8 (moving to the right) but not to b2 since you can't get there with a straight line (only possible in two or more moves)
Pawns will never be in the first or eighth rank (it would then be another piece). If a pawn is in the second rank, it can move up two spaces (not for captures). Otherwise, it can only move forward a square.
Notation for Queening a pawn is not needed
Capitalization does not matter though the letter must come before and attached to the number
The acceptable moves must be separated in some way (i.e commas, spaces, different lines, in a list)
Always assume that the bottom left corner is a1 and you are playing as White
The input can be a single string (i.e rooka3 or Rook a3 or rook a3 or Rook A3) is acceptable and can be in any order (i.e the position before the type like A3 rook). Multiple strings are also acceptable.

Winning Criteria
Shortest code wins!

Could you add a pawn in the eighth rank as a test case?

@HyperNeutrino Pawns will now never be on the eighth rank. The extra test cases for queening or changing the pawn to a bishop, rook, or knight was seen as quite annoying

Okay. Thank you for clarifying.

Is it necessary to include pawn captures? If I understand correctly, there is only one piece on the board.

@HyperNeutrino Must have missed that. Pawn captures are not needed

Can input be taken as an array of two strings? (it says "input can be a single string" but does not say it must be). Also, can output be an array of strings?

@HyperNeutrino Yes

Should we assume that the pawns are white(refering to the figure) and moving from row 1 to 8?

@officialaimm Yes as you are white

Your first test case is incorrect. It should read a1 a2 a3 a4 a5 a6 a7 b8 c8 d8 e8 f8 g8 h8, not b1 ... h1.

Your fourth test case is incorrect. It should be b3 c2, not b2 c3.

Can't check for details right now, but duplicate maybe?

@MartinEnder Well, I do include pawns as test cases though

@MartinEnder I think it might count as a duplicate, because answers there can be trivially edited to include pawns, but I'm not sure about the rules of duplicates.

I closed as a dupe. The pawn case is new though -- maybe that could be its own question?

JavaScript (ES6), 256 ... 229 227 bytes
Takes input as two strings (p, s), where p is the case-insensitive name of the piece and s is the source square. Returns a space-separated list of destination squares.
f=(p,s,i=128)=>i--?f(p,s,i)+([x=255,x<<8,2,x,195,60][P=(I=parseInt)(p,32)*5&7]>>i/8&((d=i%8)<(S=(x=I(s,18)-181)/18|x%18*16,P>2?8:P<2|S>23||2))&!((S+=I('gfh1eivx'[i>>4],36)*(i&8?d+1:~d))&136)?'abcdefgh'[S&7]+(S+16>>4)+' ':''):''

How it works
Piece name decoding
The name of the piece p is converted to an integer P by parsing it in base 32, multiplying the result by 5 and isolating the 3 least significant bits: parseInt(p, 32) * 5 & 7
 Piece    | As base 32 |        * 5 | & 7
----------+------------+------------+----
 "king"   |     674544 |    3372720 |  0
 "knight" |  695812669 | 3479063345 |  1
 "pawn"   |        810 |       4050 |  2    NB: 'pawn' is parsed as 'pa', because 'w'
 "queen"  |   28260823 |  141304115 |  3        is not a valid character in base 32
 "rook"   |     910100 |    4550500 |  4
 "bishop" |  388908825 | 1944544125 |  5

In addition to being a perfect hash, a good thing about this formula is that all sliding pieces (Queen, Rook and Bishop) appear at the end of the list, which allows to identify them with a simple P > 2.
Source square decoding
The source square s is converted to an integer S by parsing it in base 18 and converting the result to 0x88 coordinates.
That leads to the following board representation:
     a    b    c    d    e    f    g    h
8  0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77
7  0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67
6  0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57
5  0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47
4  0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37
3  0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27
2  0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17
1  0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07

Directions encoding
There are 16 possible directions: 4 along ranks and files, 4 along diagonals and 8 for the knights.
As hexadecimal:                     As decimal:

      +0x1F       +0x21                    +31         +33
+0x0E +0x0F +0x10 +0x11 +0x12        +14   +15   +16   +17   +18
      -0x01 [SRC] +0x01                     -1  [SRC]   +1
-0x12 -0x11 -0x10 -0x0F -0x0E        -18   -17   -16   -15   -14
      -0x21       -0x1F                    -33         -31

Therefore, the list of directions that a piece can move towards can be encoded as a 16-bit bitmask.
Bit:    |   F   E   D   C   B   A   9   8   7   6   5   4   3   2   1   0 | As
Vector: | +33 -33 +31 -31 +18 -18 +14 -14  +1  -1 +17 -17 +15 -15 +16 -16 | decimal
--------+-----------------------------------------------------------------+--------
King    |   0   0   0   0   0   0   0   0   1   1   1   1   1   1   1   1 | 255
Knight  |   1   1   1   1   1   1   1   1   0   0   0   0   0   0   0   0 | 65280
Pawn    |   0   0   0   0   0   0   0   0   0   0   0   0   0   0   1   0 | 2
Queen   |   0   0   0   0   0   0   0   0   1   1   1   1   1   1   1   1 | 255
Rook    |   0   0   0   0   0   0   0   0   1   1   0   0   0   0   1   1 | 195
Bishop  |   0   0   0   0   0   0   0   0   0   0   1   1   1   1   0   0 | 60

The absolute values of the direction vectors can be stored in base 36:
[16, 15, 17, 1, 14, 18, 31, 33][n] <==> parseInt('gfh1eivx'[n], 36)

Formatted and commented
f = (p, s, i = 128) =>                     // given a piece p, a square s and a counter i
  i-- ?                                    // if i is >= 0:
    f(p, s, i) + (                         //   do a recursive call to f()
      [ x = 255, x << 8, 2, x, 195, 60 ][  //   take the direction bitmask for:
        P = (I = parseInt)(p, 32) * 5 & 7  //   P = piece index in [0 .. 5]
      ] >> i / 8 & (                       //   and test the bit for the current direction
        (d = i % 8) < (                    //   d = current move distance - 1
          S = (x = I(s, 18) - 181) / 18 |  //   S = source square in
              x % 18 * 16,                 //       0x88 representation
          P > 2 ? 8 : P < 2 | S > 23 || 2  //   compare d with the maximum move range for
        )                                  //   this piece
      ) ?                                  //   if the above test passes:
        (                                  //     we add to S:
          S += I(                          //       the absolute value of the vector of
            'gfh1eivx'[i >> 4], 36         //       the current direction,
          ) *                              //       multiplied by
          (i & 8 ? d + 1 : ~d)             //       the move distance with the vector sign
        ) & 136 ?                          //     if the result AND'd with 0x88 is not null:
          ''                               //       this is an invalid destination square
        :                                  //     else:
          'abcdefgh'[S & 7] +              //       it is valid: convert it back to ASCII
          (S + 16 >> 4) + ' '              //       and append a space separator
      :                                    //   else:
        ''                                 //     this is an invalid move
    )                                      //   end of this iteration
  :                                        // else:
    ''                                     //   stop recursion

Test cases

f=(p,s,i=128)=>i--?f(p,s,i)+([x=255,x<<8,2,x,195,60][P=(I=parseInt)(p,32)*5&7]>>i/8&((d=i%8)<(S=(x=I(s,18)-181)/18|x%18*16,P>2?8:P<2|S>23||2))&!((S+=I('gfh1eivx'[i>>4],36)*(i&8?d+1:~d))&136)?'abcdefgh'[S&7]+(S+16>>4)+' ':''):''

console.log(f('Rook',   'a8'));
console.log(f('Pawn',   'a2'));
console.log(f('Pawn',   'a3'));
console.log(f('Knight', 'a1'));
console.log(f('Bishop', 'h1'));
console.log(f('King',   'b2'));
console.log(f('Queen',  'h1'));

This is just... amazing... Wow. Good job!

Python 2, 484 472 423 406 bytes
This is a lot longer than I wanted it to be.
i=input()
a=ord(i[1][0])-97
c=int(i[1][1])
g=range(-8,8)
b=sum([[(a-x,c-x),(a-x,c+x)]for x in g],[])
r=sum([[(a-x,c),(a,c-x)]for x in g],[])
print[chr(x[0]+97)+str(x[1])for x in set([[(a,c+1)]+[(a,c+2)]*(c==2),b,sum([[(a-x,c-y)for x,y in[[X,Y],[X,-Y],[-X,Y],[-X,-Y]]]for X,Y in[[1,2],[2,1]]],[]),r,b+r,[(a-x,c-y)for x in[-1,0,1]for y in[-1,0,1]]]['wsioen'.find(i[0][2])])-set([a,c])if-1<x[0]<8and 0<x[1]<9]

-12 bytes by removing some unnecessary variable names
-49 bytes thanks to ovs by splitting s into multiple variables
-17 bytes thanks to ovs by switching from range to comparison
Input is taken as ['PieceName', '<letter><num>']. Output is given as an array of strings in the same 1-indexed a-h format <letter><num>.

How do you enter the input (more specifically, what format)

@AnthonyPham Forgot to mention; I will edit into post. Thanks.

If you split s into 2 variables, you can save ~50 bytes

You can replace in range with comparison

@ovs Thank you, 66 bytes total :P

You can save a few more bytes with z=sum and replacing sum with z.

@AnthonyPham Actually, it doesn't change the byte count. Thanks anyway!