Skip to content

joeweller/html5-table-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Intro to Html5TableGenerator

Html5TableGenerator will accept either a .csv/.tsv file or a nested list of values and will return a html table. It also features the ability to use classes found within the CSS/JS web framework: Bootstrap4

Usage

Html5TableGen may only take in one source argument; file or list

from tablegen import Html5TableGenerator

# generate a table from a local .csv file
table_csv = Html5TableGenerator(
        file='path-to-file.csv',
        file_type='csv',
        footer=True,
        bs=False,
)

# print html table to screen
print(table_csv.output())


# generate a table from a nested list

data_list = [
        ['DOB', 'Name', 'Location'],
        ['02/1989', 'Bill', 'Spain'],
        ['12/1984', 'Pat', 'India'],
]

table_data = Html5TableGenerator(
        data=data_list,
        bs=True,
        footer=False,
)
        
# print html table to screen
print(table_data.output())

About

Generate a HTML5 table from either csv/tsv or 2d-list

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages