Palview4 Manual  *   The Palview Pages  *   The Palview Developers Forum  *   Home  *   Palamede

Crosstables and Tournament Coverage

One of the more difficult tasks in tournament coverage over the web is creating crosstables. This is especially true if you want your crosstable to act as an index to the games themselves. Palview provides a number of options that allow you to quickly and easily create both, a crosstable, and a set of individual Html-JavaScript pages for the games of the event. The crosstable itself can be linked to the individual games so that it also acts an index. To save server space, all the individual game's Html files are linked to a single JavaScript file that is shared by all the games in the event.

With Palview4 you now have even more options for making crosstables. Previously, you created a crosstable using the batch htmltype page. This created an Html file that contained the crosstable and several individual gN.htm files, one for each game. These separate games were linked to from the crosstable. But with Palview4 you can now create a crosstable that links to the separate games using the new game viewer. This can be done simply by inserting a crosstable command directly into the new magazine page. For more information on inserting a crosstable into a magazine page, please see Crosstable Insertion.

It is important to note that this section of the manual only deals with the aspects of creating a crosstable and working with it to provide tournament coverage. What the actual games themselves will look like, and what features they will have, is determined by INI settings that are not covered here. See The Palview INI File for more details on that topic.

Palview Crosstable Index

Crosstable Basics A quick tutorial

The Match Crosstable

The Round Robin Crosstable

The Swiss Crosstable

The Simultaneous Crosstable

Using Palview for Tournament Coverage

Crosstable Basics

Palview can generate a number of crosstable types, depending upon the type of the event. It can produce a Match, Round Robin (including multiple Round Robins), Simultaneous and a Swiss (or Open) crosstable. In order for Palview to be able to generate a correct crosstable for the event, you must insure that all the games for the event are in the PGN file. In the case of the batch page crosstable, every game must belong to only a single event -- the event you want a crosstable for. If even a single game in the PGN does not belong to the event, Palview will not be able to generate a proper crosstable. In this case, it will generate a simple list of links to each of the game's Html files only. For crosstables generated by the new insertion command, you select the event that you want a crosstable for and Palview will select only those games from the PGN file that belong to the event when creating the crosstable. (For more information see Crosstable Insertion.)

Once Palview has selected all the games for the crosstable, or determined that all the games in the PGN file do indeed belong to a single event in the case of the batch page, it then calculates the type of event using the following logic. Using P = total number of players, G = total number of games, and SNGP = TRUE if the same number of games played by each player:

If P = 2, then it is a Match.
If P-1 = G, then it is a Simultaneous.

  Calculate X = (P(P-1))2 and R = GX

If X=G and R=1 and SNGP, then it is a Round Robin
If XR=G and SNGP, then it is a Multiple Round Robin

For all other cases, Palview will assume it is a Swiss.

Assuming that you have a PGN file that contains all of the games from the event that you want a crosstable for, the next step is to prepare an INI file. We recommend that you make a copy of an existing Palview INI file and rename it after the PGN file. For example, if you were going to generate a crosstable for the Dortmund 99 tournament, and your PGN was named dort99.PGN, then you would want a dort99.INI file to match it. You can then begin to prepare the options in this INI file.

Palview4 now gives you a number of new ways to generate a crosstable, but we will only examine how to create one using the batch page in order to explain the various INI settings that affect the crosstable itself which are common to all the crosstables. For specific information on creating crosstables by insertion into a magazine page, please see Crosstable Insertion.

The first option that must be set for generating a crosstable using the batch page is:

htmltype = batch

Palview uses the batch mode to create both the crosstable and the individual game files. The next INI option that you will certainly want to set is the crosstablecss which allows you to select a Cascading Stylesheet (CSS) specifically for the crosstable itself. The crosstable will be written to its own Html file by Palview and the program will use the filename you provide in the crosstablecss option as the CSS file to link to. The crosstable itself uses a number of new Cascading Stylesheet (CSS) classes so that you can have as much control over the look of the table as you want. The actual details about the crosstable's CSS classes are explained in the section: Palview and Cascading Stylesheets. An example of the crosstablecss option would be:

crosstablecss = "p3cross.css"

Note, however, that a crosstable inserted into a magazine uses the INI option magazinecss to set the name of a Cascading Stylesheet file and it expects all the CSS classes for the crosstable to be in that file. For more information on this, please see the section CSS for the Magazine.

The rest of the information in this section applies equally to any crosstable generated by Palview irregardless of how it is created.

The next important decision to make is whether you want Palview to generate only a crosstable, but no games. This can be useful as a way of creating the Html of a crosstable so that you can Cut & Paste it into some other web page that you are working on. In that case, it is up to you to add the necessary Html code to your own file to link to the crosstablecss file. But it is most likely that you do want all the games generated along with the crosstable, so you would set the option:

crosslink = on

Your next decision is to select the characters that Palview will use, when generating your crosstable, to indicate a win, a loss, a draw, and the character to use in a Round Robin crosstable where the row and column matches the same player. By default, Palview will use the standard characters "10x" as in this Round Robin crosstable:

To enter the above characters to be used in your crosstable, you would use this INI option:

crosscharacters = "10x"

To enter the character into Notepad, you can hold down the Alt key then press the 0 key on the numeric keypad followed by 189 (also on the numeric keypad).

An alternative set of characters that is commonly used is:

crosscharacters = "10=*"

The same crosstable using the above characters would look like this:

The next decision to be made is the formatting of the player's names in the crosstable. This is determined by the crossnamepattern INI option. In the above example, only the last name has been used. You can set 'last name' as the format with this:

crossnamepattern = last

For the full number of available settings see the crossnamepattern itself.

The player's names are taken from the player Tags, White and Black, in each game of the PGN file. PGN expects these names to appear in the same format as they would appear in a telephone directory. That is, last name, followed by a comma, followed by the rest of the name. Bobby Fischer's name would appear in a PGN file as:

Fischer, Robert J.

It is important to note that Palview expects consistent naming throughout the PGN file. The names must appear exactly the same otherwise Palview will assume that the different names are for different players. For this reason we recommend that you use a good chess database that uses strong consistent naming. ChessBase has an excellent database that is updated every year. This database now contains over 2 million games and comes in two formats. One, called the BIG database, contains only games without annotations, while the MEGA database contains over 45,000 annotated games taken mostly from the ChessBase Magazine CDs. Either of these databases would be ideal for working with Palview. Another source of up to date games is provided by Mark Crowther's excellent weekly chess news site, TWIC (The Week In Chess).

Next, you need to determine what additional information you want Palview to insert about each player after his name. In the above crosstables you can see that each player's name is followed by his Title, the flag of his country, and his Elo rating. All of these columns of information are optional and are determined by the crosstags INI option. You can choose to have none of the additional information included in your crosstable, or you can select any combination of the three available pieces of information. If you wanted all the information, as in the above crosstables, you would set the INI option:

crosstags = title, country, elo

The information itself is generally taken from the PGN Tags: WhitieTitle, BlackTitle, WhiteCountry, BlackCountry, and WhiteElo, BlackElo. But another way of providing the title, elo, and country information to Palview is to use the player command, which can save you a great deal of hand editing of many PGN games when generating crosstables. This will be explained in more detail below, but note that the player option is only valid for crosstables created using the batch page — not for the other page types.

One side note about the use of flags in crosstables. If you decide to use the country token in the crosstags command, you must also set the flags = on otherwise Palview will use the three letter FIDE country code instead of the actual flag of the country. To see what this would look like, look at the Astana Round Robin crosstable in the Round Robin Crosstable section below.

The only remaining decision to be made before generating your crosstable is whether you want it to be tooltipped. This can be a very valuable option and we recommend that you use it. You set this option with:

tooltipcross = on

When a viewer hovers the mouse over any of the game results in the crosstable, the extended game information will be shown in a tooltip. Here is an example below:

Notice that the extended game information tooltip shows which player played White in the game and which played Black. This is shown in the order of the player's names as in Leko - Adams. The next field shows the round the game was played in. In the example the game was played in round 3. The next field shows how many moves were played in the game. In the example the were (30) moves in the game. Note that this is not how many ply, but how many actual moves, so the last move of the game was either White or Black's 30th. The next field shows the actual opening name taken from either the Opening PGN tag or provided by the file. In this example the opening name is Ruy Lopez. The last field shows the ECO code of the opening. In the example the game was a Ruy Lopez with ECO code C89.

One note about Palview and tooltips. These tooltips will not be visible in Netscape 4.x browsers since this browser does not support the use of the Html 'Title' attribute. Internet Explorer 4 and above, along with the new Netscape 6 and many other browsers, do support it.

This should provide you with the basic knowledge you will need to create crosstables with Palview. Once you have used Palview to create your crosstable and games, you will find a separate Html and JS file named after the original PGN, and several more Html files named g0.htm, g1.htm, etc., one gN.htm file for each game Palview creates. You will find the crosstable itself in the Html file named after your original PGN.

The Match Crosstable

Below is an example of the Match crosstable. The only unique aspect of this crosstable is the information within the tooltip. You will notice that the player's names and the round information are absent. It was considered unnecessary for a match. However, the tooltip still displays the number of actual moves played in the game along with the ECO code.

You will also notice that the last column, after the Totals (=) column, also shows the Performance Rating of the two players. You must use the player INI option and the batch page to set the Performance Rating for each player if you want this information displayed. You must also provide the actual value to be used, as the program will not attempt any calculation. Crosstables inserted into a magazine don't use the player INI option, so performance ratings are not available for them.

The Round Robin Crosstable

Below is a typical example of a Round Robin crosstable. This is the most complex crosstable that Palview can currently generate.

You can see that Palview will attempt to calculate the Category of the tournament and will provide that information using Roman Numerals in the top right hand corner. Our first example, from Dortmund 99, is a category 19 tournament. The category of a tournament is based upon the average Elo rating of the players. A category I tournament has an average Elo of 2250 to 2274, II is 2275 to 2299, etc. Every additional 25 Elo points produces another category.

In addition to calculating the Category of the tournament, Palview will use the Sonneborne-Berger tie break system for resolving the order of tied players.

You can also see from the crosstable below that Palview will create complete tooltips for each game providing the names of the players, in the order White - Black, the round of the game, r2, the number of moves in the game, (48), and the ECO code, C65. All the crosstables, except the Match, will provide all the above information in the tooltip, provided that you have enabled tooltipping with tooltipcross INI option.

Below is a typical example of a Double Round Robin crosstable. Some may find that multiple Round Robin crosstables look best if you use the = and * characters as shown. You can select these with the crosscharacters INI option. Also notice in this example that the flags have been replaced by the three letter FIDE country code. If you don't want flags to be used then you can set the flags = off.

The Swiss Crosstable

Below is an example of the typical Swiss, or Open, crosstable that Palview will produce. In fact, the program will use this format as a default for any event that it does not currently understand. It is essentially a list of the players sorted by their individual scores. The program will use the Sonneborne-Berger tie break system for resolving the order of tied players.

The ability to have Palview provide tooltips for each of the games in the crosstable is especially useful for the Swiss or Open event. In the usual crosstables produced for these types of events, there is really no way to determine the names of the opponents directly from the crosstable itself. But using tooltips allows you to view the names of both players along with other details of the game. We recommend that you use the tooltipping option in your INI file by setting:

tooltipcross = on

There is one additional INI option, or command, that is only used for the Swiss crosstable. This is the maxswissplayers option.

The maxswissplayers command is used to limit the number of players to be listed in the crosstable. These types of events often have a great number of competitors, but it is rare that you would want to list all of them in your crosstable. The maxswissplayers allows you to set the number of players you want. The above crosstable was generated using the command:

maxswissplayers = 10

It is important to remember that all the games from the event must be in the PGN file passed to Palview in order for it to generate a correct crosstable. But it will only generate Html files for the games that will be linked to the crosstable as determined by the maxswissplayers option.

The Simultaneous Crosstable

Every now and then a local Master, or even Grandmaster, will take on all comers in an event that is known as a Simultaneous Exhibition. This usually takes the form of the 'Master' moving around from table to table, making his move against the local patzer, and then moving on to the next victim. But sometimes Garry Kasparov will visit your country and torture your National team. Hence the two crosstables below.

The Simultaneous crosstable only lists the Master's name and his results from the event. This seems reasonable since the Master's score is really all that anyone is interested in. But you can use the tooltipcross option to provide further information about each individual game in a tooltip. This information will include the name of the Master's opponent, among other bits of useful information.

tooltipcross = on

You may wonder why there are actually two crosstables for this single event. That is because of its odd nature -- it is a multiple round simultaneous. Four games were played on two separate days. However, Palview cannot determine that this particular example of a simultaneous exhibition is indeed a simultaneous if all the games are in the same PGN file. (See the above explanation on how Palview determines the type of an event.) For this particular example, we had to divide the games into two separate PGN files that contained the games from each day. This resulted in two separate crosstables. This is a rare exception to the rule, but it is something to keep in mind.

Using Palview for Tournament Coverage

This part of the manual will discuss the use of Palview for tournament coverage, but does not include the topic of Live Game Broadcast. For more information on that particular topic, see Palview and Live Game Broadcasts.

Setting Up the Website

If you run a chess news website, and you want to cover a number of tournaments using Palview and its batch crosstable generation, then you will want to prepare your site in a way that will keep things clean. You are certainly likely to use a new folder, or directory, for each event. This helps to keep things well organized and is highly recommended. Next, you will want to create separate folders for the pieces, board images, etc. another folder for the flags, and still another for the chess symbols. We recommend you place these in the folders: jpc, flag, and sym as shown below.

In the above server layout you can see that the two folders dort99 and astana01 have been selected, shown in blue. These folders represent the locations of the Dortmund 99 and Astana 2001 tournament files. In these folders you would place the dort99.PGN, dort99.INI, dort99.htm, dort99.JS, and all the g0.htm to gN.htm files of the Dortmund tournament. You would do the same for the Asanta tournament. Using this setup, you could then provide a link to the crosstable from your site's main page and this would allow your visitors access to the replayable games, via the crosstable, and to the PGN file, using the pgnlink at the bottom of each game's page.

In order for such a setup to work, you would need to use relative urls for the jpc, flag, and sym folders. You would use these settings in both of the dort99.INI and astana01.INI files:

imgurl = "../jpc"
flagurl = "../flag"
symurl = "../sym"

You will also notice in the above server image that the two CSS files are also above the two tournament folders. In order to access these, and keep a consistent look to your site, you would need to make these additional changes to the INI files to reflect relative urls:

crosstablecss = "../p4cross.css"
stylesheet = "../p4style.css"

Much of the above discussion applies equally to setting up the website for a magazine page. In the folder image above, you can see a folder called magazine. In this folder you would place your completed magazine page, the game viewer files, and all the gN.htm game files. In fact, you may want to create a separate folder for each month's issue of the magazine with names like, magnov03, magdec03, magjan04, etc. you could then create an index that links to each past volume of the magazine. In each magazine folder, you may want to create another folder specifically to hold the images that you create on your own for your site, such as a banner image, photos from an event, or images of the players etc. But keep in mind that any image url that you use in your CSS file, for example background-image:url(news_bg.gif), is relative to the CSS file — not the Html file!

One final note of caution about this setup. If you choose to use a particular boardimage, then you may need to change that INI option to be relative as well.

The Special INI Option - player

The player command is used to provide player specific information to Palview through the INI file itself. Unlike other INI options, the player command can be repeated for as many players as you need. The player option was created especially for generating crosstables and for Live game broadcasts. It has the following format:

player = "name:title:elo:country[:perfelo]"
default: none

Consider what you would need to do in order to create a crosstable of the Dortmund 1999 tournament. This tournament was a round robin with eight players participating. This means that there were (8 × 7) ÷ 2 games played, or 28. In order to provide the Title, Elo, and Country information of each player in each game, you would have to edit all 28 games in the PGN file and add these Tags.

This is a long and laborious task. With the player option, you can provide each player's information in a single line and let Palview keep track of it for each player. Here is an example for the Dortmund 99 tournament:

player = "Adams, Michael:gm:2708:ENG:2754"
player = "Timman, Jan:gm:2650:NED:2554"
player = "Anand, Viswanathan:gm:2771:IND:2745"
player = "Topalov, Veselin:gm:2690:BUL:2548"
player = "Karpov, Anatoly:gm:2700:RUS:2755"
player = "Sokolov, Ivan:gm:2656:BIH:2609"
player = "Leko, Peter:gm:2701:HUN:2863"
player = "Kramnik, Vladimir:gm:2760:RUS:2798"

Using just the above eight lines, Palview can fill in each player's information as it is needed for the crosstable and for each game's infobox. (Palview will use the country field to display the appropriate flag of the player, for example.)

The player command has at least four fields, sometimes five if you wish to provide an optional Performance Elo. The fields must always appear in this order: "name:title:elo:country[:perfelo]" and fields are separated by a colon. Empty fields are permitted as long as they are not the player's name. You still need the colon even for an empty field. For example, if you did not know Jan Timman's rating, you could write:

player = "Timman, Jan:gm::NED:2554"

The name must match the name of the player as it appears in the PGN game(s) White or Black Tag. The title can be any of GM, IM, or FM. The elo should be a four-digit number 2000 .. 3000. The country should be the three letter FIDE country code. (For the FIDE codes, see the section: The Palview Flags.) The perfelo is optional and is used to display the performance rating of the player for the event. (It is placed at the end of the crosstable.) If you do not include the perfelo, then you don't need to include an empty field for it.

Be aware that the player INI option's behavior has changed somewhat under Palview4. Under the new program version, the player option is only used in the batch page or for live game broadcasts. In all other instances the player data is ignored. This change was necessary because of the new magazine page. For more information about this change, please see the section Options Modified from Palview3.

The Headerfile and Footerfile Options

Another very useful feature that is available while generating crosstables, and the games that go with them, is the ability to have Palview automatically insert Html code into each game's Html file to be used as a header or footer banner. To do this, you must first create a simple text file that contains the Html code you want inserted into each game. This can be as simple or as complex as you like. You must remember that Palview will insert your header Html code immediately after the <BODY> tag, and your footer Html code will be inserted just before the closing </BODY> tag.

Let's assume that you have created a simple text file, called header.txt, that contains the following Html code that you want to use as a very simple banner:

<CENTER><H1>Dortmund 99</H1></CENTER>

In order to get Palview to insert the above Html code into each game as a header banner, you would use the INI option:

headerfile = "header.txt"

Using the same method above, you can also create a special footer.txt file that contains Html code for a footer banner and then use the INI option:

footerfile = "footer.txt"

A final note about using the headerfile and footerfile. If there are any CSS classes that you wish to use in the Html code that you are inserting, you can copy these classes directly into the stylesheet that you are using for the games. This will give your inserted Html code access to those CSS classes.

Round by Round Crosstables

Some chess news sites cover events on a daily basis, TWIC (The Week In Chess) being the best example of this. Such a site could use Palview to generate crosstables on a round by round basis. This is made possible by the inclusion of code in the program that tells it to skip empty games in the PGN file. This is the key to being able to create partial crosstables.

Assume that you are covering the Dortmund 99 tournament each day. After four rounds the standings are:

Assume that you have all the games from the four rounds already played. What you need to do is fill in the PGN file with empty games for the remaining rounds. These empty games should be appended to the file after the completed games. Below is an example of an empty game.

[Event "Dortmund"]
[Site "Germany"]
[Date "1999.??.??"]
[Round "5"]
[White "Karpov, Anatoly"]
[Black "Anand, Viswanathan"]
[Result "*"]


This information is required in order for Palview to correctly determine what type of crosstable must be generated. Note especially the use of the '*' as the game Result. This is also critical to tell Palview that this is indeed an empty game.

If you follow the above instructions, you will be able to create correct partial crosstables for a Round Robin or a Match. (Naturally, the program will also generate the game files as well and will link them to the crosstable.)