对齐文本
问题描述:
如何对齐是在一个while循环生成的文本对齐文本
例子:
while ($row = mysql_fetch_array($query)){
echo "<strong>E1:</strong>".$row['Ex1']."<br>";
echo "<strong>E2:</strong> ".$row['Ex2']."<br>";
echo "<strong>E3:</strong> ".$row['Ex3']."<br>";
echo "<strong>E4:</strong> ".$row['Ex4']."<br>";
echo "<strong>E5:</strong> ".$row['Ex5']."<br>";
echo "<strong>E6:</strong> ".$row['Ex6']."<br>";
}
现在定位是不是好,我想在左边,结果(E1在右对齐EX1/6)
答
echo "<strong style='float:left;'>E1</strong>
<span style:float:right;'>.$row['Ex1']."</span><br>";`
答
PHP是服务器脚本程序,因此,只是呼应,无论标记u需要标记.....
echo "<span style='float:left'><strong>E1:</strong>
</span><span style='float:right'>".$row['Ex1']."</span><br>";
答
尝试在内嵌本身
echo "<span style='float:left'><strong>E1:</strong>
</span><span style='float:right'>".$row['Ex1']."</span><br>";
进行更具体的,你想要什么这个 增添风采? – Dev