Tutorial - showing games from a PGN file

In this tutorial, I am going to show you how you can use DHTML Chess to show games from one of your pgn files, perhaps the games of a recent tournament held at your local chess club. The feature shown in this tutorial does not require any installation of DHTML Chess. Just download the DHTML Chess code and you're ready to go.


Inside the demos folder there is a file called pgn-on-web-page.html. (If you can't find that file, you should update your DHTML Chess software. ). We are going to use this file as a template.

Open that file in a text editor and choose save as. Save it with a new name, example: "club-tournament-2013.html".

After saving it, do a text search for "WorldChamp1927". You should find this line


"WorldChamp1927" is the name of a pgn file inside the "pgn" folder.

Let's say you have a pgn file named club-tournament-2017.pgn inside the dhtml-chess/pgn folder.

To display these games, replace the text "WorldChamp1927" with "club-tournament-2017" (Name of the file without the pgn extension).