User:Timeshifter/Sandbox79


 * See also: Commons:Convert tables and charts to wiki code or image files. And: Help:Table - see section on tables and the Visual Editor (VE).

18 Oct 2018 update of List of countries by incarceration rate.

I used freeware LibreOffice Calc to copy the 3 data columns from the main World Prison Brief (WPB) source.

I just copied and pasted directly from the page to LibreOffice Calc. I first alphabetized the columns on the WPB page by clicking on the column heads.

3 separate spreadsheet files. Each file had a column for nations, and a column for data.

I adjusted each data column so that there were the same number of rows in each spreadsheet file. I had to add countries into the unsentenced prisoners column for example. Even though those countries had no data for unsentenced prisoners.

In the prison population column I added commas for the blank spaces used by WPB to indicate the thousands separator. I did this all at once by using freeware NoteTab Light (or any text editor) to replace the space with the comma.

Then I copied and pasted the columns into one spreadsheet file.

I then used a sandbox page, and pasted that combined spreadsheet file into a new blank table created by the Visual Editor:
 * https://en.wikipedia.org/wiki/User:Timeshifter/Sandbox78

It took around 10 seconds in my Firefox browser. I had to tell it to allow the process to finish.

From the Wikipedia page I pasted in the nations column using Visual Editor since it had all the flags and links. I also pasted in the Notes column. One has to create a blank column first with the Visual Editor. Then paste into it via the Firefox edit menu: Edit > Paste.

So I had 2 nations columns and could compare them to make sure they aligned perfectly. They did. See it here:
 * https://en.wikipedia.org/wiki/User:Timeshifter/Sandbox78

I pasted that into Sandbox79 and removed the plain-text nations column. I used freeware NoteTab Light to add the text alignment all at once to the nations column.
 * Replace  |{{  with
 *  |style=text-align:left; |{{ 


 * Replace  |''{{  with
 *  |style=text-align:left; |''{{ 

'''"c." (circa)''' indicates "approximately". Sorting will not work correctly if it is in front of the number. So it needs to be moved after the number.

Flag templates to check
There are some flagcountry templates to watch out for:


 * undefined
 * undefined

Make sure that you have a link for "England & Wales" after it:
 * undefined. England & Wales
 * undefined. England & Wales


 * undefined
 * undefined

Make sure that you have a link for "Bosnia and Herzegovina" after it:
 * undefined (Bosnia and Herzegovina)
 * undefined (Bosnia and Herzegovina)