You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.
Implement table.title_cb which accepts a function/lambda that handles titles that won't fit in the top border.
Function signature expected:
:param str title: The title to overlay on the top border.
:param int max_len: Maximum number of characters that can be shown right now.
:return: Processed title and its length.
:rtype: (str, int)
Must return title that will fit in the border (else the table will appear broken/misaligned/wrapped) as well as the length of the string.
Length values are for visible characters. When using CJK (Chinese/Japanese/Korean) characters some may be len() of 1 but take up 2 visible spaces in terminals. Hence API expects function to return title length in case the function truncates the string and the last character is one short of the maximum width available due to it being a CJK character.
e.g. terminal with 7 spaces available for the title and the title is "世界你好" That's 8 visible spaces so if the function truncates it to "世界你" API expects length of 6 to be returned.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Implement
table.title_cb
which accepts a function/lambda that handles titles that won't fit in the top border.Function signature expected:
Must return title that will fit in the border (else the table will appear broken/misaligned/wrapped) as well as the length of the string.
Length values are for visible characters. When using CJK (Chinese/Japanese/Korean) characters some may be len() of 1 but take up 2 visible spaces in terminals. Hence API expects function to return title length in case the function truncates the string and the last character is one short of the maximum width available due to it being a CJK character.
e.g. terminal with 7 spaces available for the title and the title is "世界你好" That's 8 visible spaces so if the function truncates it to "世界你" API expects length of 6 to be returned.
The text was updated successfully, but these errors were encountered: