Php 对齐while循环中的文本
如何对齐while循环中生成的文本 例如:Php 对齐while循环中的文本,php,html,css,Php,Html,Css,如何对齐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'
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在右边对齐PHP是服务器脚本,所以,只要回显,你需要的任何标记都可以
echo "<strong style='float:left;'>E1</strong>
<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>";
试试这个
在内联中添加样式
echo "<span style='float:left'><strong>E1:</strong>
</span><span style='float:right'>".$row['Ex1']."</span><br>";
具体点说,你想要什么?