0

如何制作横版的学生证?

此代码以垂直形状显示身份证,我想要水平形状。我该如何解决这个问题?请帮我解决这个问题。

我想要这样:

----------------------------------
| Photo    | Student Detail      |
----------------------------------
  here     |Student Name :       |
           |Roll No:             |
  photo    |Classs :             |
           |Grn    :             |
           |Father Name :        |
----------------------------------

现在它的显示如下:

--------------------------------------------------------
Photo                  |        Student Detail         |
--------------------------------------------------------
      here     |                     
               |
      photo    |
               |
               |
--------------------------------------------------------
Student Name:                                          |
Roll No:                                               |
Class:                                                 |
Grn:                                                   |
Father Name:                                           |
--------------------------------------------------------

代码:

echo "<table class='hovertable' border='1' cellpadding='0' cellspacing='0'>";
echo "<tr><th>Photo</th><th>Student Detail</th></tr>";

if ($rows > 0) {
        while($row = mysql_fetch_array($result)) {
                echo "<tr><td>";
      echo "<img src=http://localhost/student/images/".$row['photo'] ." width='150' height='100'></a></td>";
      echo "<tr><tr><td>";
                echo $row['name'];
                echo "</tr></td>";
        echo "<tr><td>";
                echo $row['rollno'];
                echo "</tr></td>";
        echo "<td>";
                echo $row['fathername'];
                echo "</tr></td>";
        echo "<td>";
        echo $row['class'];
                echo "</td></tr>";

        }
} else {
        echo "<tr><td colspan=\"5\">No results found!</td></tr>";
}

echo "</table>";
4

1 回答 1

1

详细信息在照片下方,因为您之前开始了新行$row['name']。您不能按照您的方式嵌套行。如果您想将详细信息与照片并排显示,则必须从<td>标签开始,然后用<br/>

echo '<td>';
echo $row['name'], '<br/>';
echo $row['rollno'], '<br/>';
echo $row['fathername'], '<br/>';
echo $row['class'], '<br/>';
echo '</td></tr>';

<div>标签,正如@Fabio 已经在评论中建议的那样。

于 2013-04-15T07:22:05.657 回答