3.137.180.32 |    

Navigation

Google Advertisement

Erstellt eine HTML Tabelle in definierten und errechnet die Rest-anzeige.

colums
  1. #!/bin/bash
  2.  
  3. array=( Januar Februar März April Mai Juni Juli )
  4.  
  5. cols=6 # Anzahl der Spalten...
  6. tr=0
  7. td=0
  8.  
  9. echo "<table border=\"0\">"
  10.  
  11. # Array loopen...
  12. for (( i=0; i<${#array[*]}; i++ )) {
  13.  
  14.         # Berechnung der Tabellen-Ausgabe
  15.         # ( $tr dient als Zeilen-Zaehler )
  16.         [ "$td" -eq 0 ] && echo -e " <tr>"
  17.         tr=$(( $tr+1 ))
  18.         echo -e "  <td>${array[$i]}</td>"
  19.         td=$(( $td+1 ))
  20.  
  21.         if [ "$td" -eq "$cols" ]; then
  22.             echo -e " </tr>"
  23.             td=0
  24.         fi
  25.  
  26. }
  27.  
  28. # Rest-Anzeige - Tebellen-Zellen mit <td> </td> fuellen
  29. if [ "$td" -gt 0 -a "$(( $cols-$td ))" -gt 0 ]; then
  30.         for (( tr=$(( $cols-$td-1 )); tr>=0; tr-- )); do
  31.                 echo -e "  <td> </td>"
  32.         done
  33.         echo -e " </tr>"
  34. fi
  35.  
  36. echo "</table>"
Parsed in 0.003 seconds at 275.53 KB/s

Search
 
Full text search by name and content of a snippet.

User online
There are 2 users online.

Tags Cloud

Latest snippets
str2seconds
(Bash::Function)
is_integer
(Bash::Function)
file_rotate
(Bash::Function)
confirm
(Bash::Function)
is_workingtime
(Bash::Function)
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)