%% Format Table and Capture as String
% Create a table with customer names, account balances, and amounts of recent deposits.

Customer = ["Rivera";"Park";"Gupta"];
Balance = [5670;868.54;3015];
LastDeposit = [325.10;35.20;70];
T = table(Customer,Balance,LastDeposit)

%
% Capture the table as a string. Use name-value arguments to set the numeric format to bank style, suppress the boldface markup of the column headings, and remove an extra blank line with compact line spacing.

strT = formattedDisplayText(T,'NumericFormat','bank','SuppressMarkup',true,'LineSpacing','compact')

% Copyright 2020 The MathWorks, Inc.