程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> C# >> C#入門知識 >> C# Tips: Draw a data table in console

C# Tips: Draw a data table in console

編輯:C#入門知識

      
                                 
                             
               
                
                                          
              List<List<>> 
                
                                                                                              
                DefaultElement =  
                   
                               header =                  rows =  List<List<>>                 TextAlignment =  
                
                             
                                                  
               SetHeaders(                  header =  
               AddRow(List<>    
               AppendLine(StringBuilder hsb,                                                                      
                 hsb.Append(                  hsb.Append( (, length -                  hsb.Append(  
                
                                                                    
                                 (header !=                                       
                       maxlen = rows[                      ( i = ; i < rows.Count; i++                          (rows[i].Count >                             maxlen = 
                        
                                 maxlen = 
                  ( i = ; i < rows.Count; i++                                                                
                      (rows[i].Count <                           loops = maxlen -                          ( k = ; k < loops; k++                         (rows[i].Count >                                                                                                     
                         rows[i].RemoveRange(maxlen, rows[i].Count -  
                     
                      ( j = ; j < rows[i].Count; j++                           (rows[i][j] ==                              rows[i][j] =                           (rows[i][j] ==                              rows[i][j] =    
                
                                                       
                                [] widths =                   (header !=                                            
                     widths =                        ( i = ; i < header.Length; i++                         widths[i] =                  
                       count =                     widths =                        ( i = ; i < count; i++                         widths[i] = -  
                  (List<> s                        ( i = ; i < s.Count; i++                          s[i] =                          (s[i].Length >                             widths[i] =   
                   
                
                                                                    
                
               BuildRowFormat(                   rowFormat =                  ( i = ; i < widths.Length; i++                       (TextAlignment ==                         rowFormat +=  + i.ToString() +  + (widths[i]) +                      
                         rowFormat +=  + i.ToString() +  + (widths[i]) +   
                 rowFormat = rowFormat.Insert(rowFormat.Length,                    
                
                             
                                 (rows.Count ==                       Console.WriteLine(                        
                 [] widths =                  rowFormat = 
                                  
                 StringBuilder toFindLen =                  toFindLen.AppendFormat(rowFormat, (header ==  ? rows[                  length =                  (Console.BufferWidth <                     Console.BufferWidth = 
                                  
                 StringBuilder hsb =                   hsb.AppendFormat(rowFormat, (header ==  ? rows[  
                                  
                  idx =                   (header ==                      idx =                   ( i = idx; i < rows.Count; i++     
   
 
               Main(                  
                 ConsoleTable ct =                  ct.TextAlignment =                 ct.SetHeaders( [] { , ,                  ct.AddRow( List<> { , ,                  ct.AddRow( List<> { , ,                  ct.AddRow( List<> { , ,       }

 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved