def get_header_files_size_data(sources_dir, header_files_by_size, rows_count):
    """
    Builds table rows list containing data about header files sizes (largest/smallest).

    :param sources_dir: configured sources directory
    :param header_files_by_size: list of header files ordered by size (smallest to largest)
    :param rows_count: number of rows to build
    :return: the requested table rows
    """
    data = [
        ("-------------------", "----", "--------------------", "----"),
        ("Largest Header File", "Size", "Smallest Header File", "Size"),
        ("-------------------", "----", "--------------------", "----")
    ]

    largest_headers = header_files_by_size[-rows_count:]
    largest_headers.reverse()
    smallest_headers = header_files_by_size[:rows_count]
    for n in range(0, rows_count):
        top = largest_headers[n] if len(largest_headers) > n else None
        bottom = smallest_headers[n] if len(smallest_headers) > n else None

        data.append(
            (
                top.file_path.replace(sources_dir, '~') if top is not None else "-",
                "{0:.2f} KB".format(top.size / 1024) if top is not None else "-",
                bottom.file_path.replace(sources_dir, '~') if bottom is not None else "-",
                "{0:.2f} KB".format(bottom.size / 1024) if bottom is not None else "-"
            )
        )

    return data