看板 PHP 關於我們 聯絡資訊
※ 引述《noguchi (耶?!)》之銘言: 我現在要產生12列4欄的文字方塊 前面會有編號 當變兩位數時文字方塊會跟著往後退一格 但我想讓他數字後一位對齊 1. 文字方塊 1. 文字方塊 2. 文字方塊 2. 文字方塊 . => 變 . . . . . 10. 文字方塊 10. 文字方塊 以下是程式碼..我可以怎麼改呢?? <? $n=12; for ($i=1; $i<=$n; $i++) { echo "&nbsp;&nbsp;&nbsp;<font face='Courier New, Courier, mono'>"; echo str_replace(" ","&nbsp;",sprintf("%4d",$i)); //4是看你要格式化幾位數 echo "</font>.&nbsp;&nbsp;&nbsp; <input type=\"text\" name=\"sid[$i]\"> <input type=\"text\" name=\"name[$i]\"> <input type=\"text\" name=\"phone[$i]\"> <input type=\"text\" name=\"email[$i]\"><br> "; } ?> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.64.183.208 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.42.176 ※ 編輯: cfw 來自: 140.112.42.176 (08/18 11:24)
cleanwind:囧 ... 我看錯了 08/18 12:09
noguchi:可以了 謝謝! 08/19 12:15