File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed 
module/core/format_tools/src/format/output_format Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -248,8 +248,19 @@ impl TableOutputFormat for Table
248248          write ! (  c. buf,  "{}" ,  cell_prefix ) ?; 
249249
250250          println ! (  "icol : {icol} | irow : {irow} | width : {width} | cell_width : {cell_width} | slice.len() : {}" ,  slice. len( )  ) ; 
251-           let  lspaces = (  width - cell_width )  / 2 ; 
252-           let  rspaces = (  width - cell_width + 1  )  / 2  + cell_width - slice. len ( ) ; 
251+ 
252+           let  lspaces = if  cell_width > width { 
253+             0 
254+           }  else  { 
255+             (  width - cell_width )  / 2 
256+           } ; 
257+           
258+           let  rspaces = if  ( cell_width > width)  || ( slice. len ( )  > cell_width)  { 
259+             0 
260+           }  else  { 
261+             (  width - cell_width + 1  )  / 2  + cell_width - slice. len ( ) 
262+           } ; 
263+           
253264          // println!( "icol : {icol} | irow : {irow} | width : {width} | cell_width : {cell_width} | lspaces : {lspaces} | rspaces : {rspaces}" ); 
254265
255266          if  lspaces > 0 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments