kyu_6.array_to_html_table package

Submodules

kyu_6.array_to_html_table.test_list_to_html_table module

Test for -> Array to HTML table.

Created by Egor Kostan. GitHub: https://github.com/ikostan

class kyu_6.array_to_html_table.test_list_to_html_table.ArrayToTableTestCase(methodName='runTest')[source]

Bases: TestCase

Testing to_table function.

_classSetupFailed = False
_class_cleanups = []
test_array_to_table_function()[source]

Testing to_table with various test data.

Returns:

kyu_6.array_to_html_table.to_table module

Solution for -> Array to HTML table.

Created by Egor Kostan. GitHub: https://github.com/ikostan

kyu_6.array_to_html_table.to_table.to_table(data: list, header: bool = False, index: bool = False) str[source]

Array to table.

Takes three arguments: data, headers, index, and returns a string containing HTML tags representing the table.

Parameters:
  • data – a 2D array (list)

  • header – an optional boolean value. If True, the first row of the array is considered a header, defaults to False

  • index – an optional boolean value. If False, the first column in the table should contain 1-based indices of the corresponding row. If headers arguments is True, this column should have empty header. Defaults to False.

Returns:

a string containing HTML tags representing the table.

Module contents

Array to HTML table.