It's possible to create HTML page from a CSV file, with the following:
import pandas as pd
df = pd.read_csv('../data.csv',delimiter=';', engine='python')
df.to_html('csv.html')
Column width of this table seems to respect the header (column title) size but for some columns content is larger then the column title and gets wrapped to next line. This happens with the following CSV, for the multi-word cells (aaaaaaaaa aaaaaaaaa
):
Name1;Name2;Name3;Name4;Name5
1;aaaaaaaaa aaaaaaaaa;b;aaaaaaaaa aaaaaaaaa;aaaaaaaaa aaaaaaaaa
2;aaaaaaaaa aaaaaaaaa;b;aaaaaaaaa aaaaaaaaa;aaaaaaaaa aaaaaaaaa
3;aaaaaaaaa aaaaaaaaa;b;aaaaaaaaa aaaaaaaaa;aaaaaaaaa aaaaaaaaa
I would like to make columns width large enough to fit content (avoid word wrap). How can I get there programmatically (using Python)?