简体   繁体   中英

Trouble rendering CSV data as an interactive table in GitHub

When viewed, any.csv file committed to a GitHub repository automatically renders as an interactive table, complete with headers and row numbering. By default, the first row is your header row. The tables were supposed to look nice as below:

在此处输入图像描述

However, there's an error happening in my tabular data, and despite indicating the error, I can't fix it:

在此处输入图像描述

在此处输入图像描述

I'm using a csv file with a semicolon separator. Would anyone have an idea of what's happening?

Many thanks.

According to the docs , Github can only do its lay-out thing with.csv (comma-separated) and.tsv (tab-separated) files.

Using a semicolon as a separator isn't supported, at least not officially, and a spurious comma in a semicolon-separated file could well throw the algorithm off.

You could try replacing all semicolons with tabs and see how you fare.

If that doesn't work, try using commas as separators and enclose all text table cell data with quotes, like:

"Liver fibrosis, sclerosis, and cirrhosis","c370800","102922","Cystic fibrosis related cirrhosis","Diagnosis of liver fibrosis, sclerosis, and cirrhosis"

Note: no spaces after the commas. Also, if you have quotes in the text fields, you will have to escape those to "" (two quotes), or the algorithm will get confused.

You may get away with using quotes only for the offending text data, but that could well be more difficult to generate than just putting the quotes around all fields.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM