noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 43/73: Improve Manage_Table : align column nu


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 43/73: Improve Manage_Table : align column numeric to the right by default
Date: Fri, 28 May 2021 05:26:35 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 03a04c0442650307d3115f3bc9f869ccc771bb4b
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Wed Apr 28 17:05:42 2021 +0200

    Improve Manage_Table : align column numeric to the right by default
---
 include/lib/manage_table_sql.class.php | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/lib/manage_table_sql.class.php 
b/include/lib/manage_table_sql.class.php
index 5b9ea64..ec897c6 100644
--- a/include/lib/manage_table_sql.class.php
+++ b/include/lib/manage_table_sql.class.php
@@ -798,8 +798,11 @@ function check()
             if ( $key == $this->sort_column) {
                 $sorted=' class="sorttable_sorted"';
             }
-            if ($this->get_property_visible($key)==true)
-                echo th("",$sorted,$this->a_label_displaid[$key]);
+
+            $style=($this->get_col_type($key)=="text")?"":' 
style="text-align:right;" ';
+            if ($this->get_property_visible($key)==true  ) {
+                echo th("", $sorted.$style, $this->a_label_displaid[$key]);
+            }
         }
         if ($this->can_update_row() && $this->icon_mod=="right")
         {
@@ -923,7 +926,7 @@ function check()
                 if (  $this->get_col_type($v) == 'text') {
                     echo td($p_row[$v],sprintf(' sort_value="X%s" 
',$p_row[$v]));
                 } elseif ( $this->get_col_type($v) == 'numeric') {
-                    echo td($p_row[$v],sprintf(' sort_value="%s" 
',$p_row[$v]));
+                    echo td($p_row[$v],sprintf('class="num" sort_value="%s" 
',$p_row[$v]));
                 } else {
                     echo td($p_row[$v],sprintf(' sort_value="X%s" 
',$p_row[$v]));
                     
@@ -965,6 +968,9 @@ function check()
                     // For custom col
                     echo td($this->display_row_custom($v,$p_row[$v],$pk_id));
                 }
+                elseif ( $this->get_col_type($v)=="numeric") {
+                    echo td($p_row[$v],' class="num" ');
+                }
                 else {
                     echo td($p_row[$v]);
                 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]