Accommodation listings in the guide can be a bit daunting to edit for those new to the process. Tables are used to render the listings as a way of making them more legible for readers. This is particularly important in large cities which can sometimes have hundreds of listings. The tabular format allows people to sort accommodation by their name, type and (if they are bookable on Travellerspoint) their popularity rating.
So the first thing to understand is how tables are structured in the code.
Important: You can only create one accommodation table on a page.
The basic code wrapping the tables are these tags.
New rows in the table are separated by a pipe and hyphen : |-
Each column in the row is separated with double pipes and with a single pipe at the start of the row.
Headers for the table are almost the same, except exclamation marks are used instead of pipes.
Those are the basics behind table formatting and can be used anywhere in the guide where a table format is desirable.
Accommodation tables are handled slightly differently to ensure that we know they are accommodation listings. They enable the sorting to work correctly.
Firstly, you need to ensure the table includes the word "Accommodation" to identify it just after the opening of the table. Like this:
Now that we know it's an accommodation table, we also know to treat some headers differently. Any header can be used in the table, but these are the main ones of interest:
With all these headers in place, your table will look like this:
To add a listing, add a row to the table and fill in the details at the right spot:
That will produce this table
|Flying Pig Downtown||Nieuwendijk 100 1012 MR||Hostel||88|
This is a good time to point out that even if all the headers exist, they are not required. If you don't know the address, or latitude / longitude details, then you can leave them blank. To leave a column blank, be sure to still keep the dividers (||) in place so we know to move on to the next column. For example, this table leaves out the address (note 4 pipes in a row where the column was left out) :
If you are leaving a column blank at the end of the table, then you don't need to bother with this since there's nothing afterwards. So this table leaves out the address AND the latitude/ longitude and will process fine.
The most likely thing you will be leaving out though is the TPID. That would end up like this:
Note: there are only three pipes before the name of the hostel. One to start the row and two to separate the first (blank) column from the next.
In general, there is often little need to create these accommodation tables from scratch. When editing your article, you can use a special function to help build the table.
Under the editing form, you will see a link to "Generate Accommodation Table". Clicking on it brings up a popup listing the countries and cities that Travellerspoint has accommodation in. If you select one of those it will generate a table for you that you can then just copy and paste into the article.
If you need to add more rows to that table, then that can of course be done, but at least the basic structure is all laid out for you.
We don't currently have any Travel Helpers for About:Editing Accommodation Tables
Except where otherwise noted, content of this article is licensed under a Creative Commons Attribution-ShareAlike 3.0 License