This commit is contained in:
Your Name 2025-04-21 21:00:00 +12:00
parent 749efef29d
commit 49948e3b80

View File

@ -46,18 +46,24 @@ void tableprint::print() {
std::wcout << std::wstring(padding, L' ') << std::wstring(title.begin(), title.end()) std::wcout << std::wstring(padding, L' ') << std::wstring(title.begin(), title.end())
<< std::wstring(total_width - title.length() - padding, L' '); << std::wstring(total_width - title.length() - padding, L' ');
std::wcout << L"\033[90m│" << std::endl; std::wcout << L"\033[90m│" << std::endl;
std::wcout << L"" << std::wstring(total_width, L'') << L"" << std::endl; // Use └─┴─┘ for bottom of title box to connect with table
std::wcout << L"";
for (size_t i = 0; i < rows[0].size(); ++i) {
std::wcout << std::wstring(col_widths[i] + 2, L'');
if (i < rows[0].size() - 1) std::wcout << L"";
}
std::wcout << L"" << std::endl;
} else {
// Print top border if no title
std::wcout << L"\033[90m"; // Dark grey color for borders
std::wcout << L"";
for (size_t i = 0; i < rows[0].size(); ++i) {
std::wcout << std::wstring(col_widths[i] + 2, L'');
if (i < rows[0].size() - 1) std::wcout << L"";
}
std::wcout << L"" << std::endl;
} }
// Print top border
std::wcout << L"\033[90m"; // Dark grey color for borders
std::wcout << L"";
for (size_t i = 0; i < rows[0].size(); ++i) {
std::wcout << std::wstring(col_widths[i] + 2, L'');
if (i < rows[0].size() - 1) std::wcout << L"";
}
std::wcout << L"" << std::endl;
// Print header // Print header
std::wcout << L""; std::wcout << L"";
std::wcout << L"\033[1;36m"; // Cyan color for header std::wcout << L"\033[1;36m"; // Cyan color for header