我对css不是很擅长,但我有以下两种形式:
//below is where it displays course name
$outputcourse = "";
$outputcourse .= "<p><strong>Course:</strong> " . $course . " - " . $coursename . "</p>";
//below is where it displays module name
$outputmodule = "";
$outputmodule = sprintf("<p><strong>Module:</strong> %s - %s</p>", $moduleId, $moduleName);
//below is form where it displays assessments drop down menu
$assessmentform = "<form action='".htmlentities($_SERVER['PHP_SELF'])."' method='post'>
<p>{$outputcourse}</p>
<p>{$outputmodule}</p>
<p><strong>Assessments:</strong> {$sessionHTML} </p>
</form>";
echo $assessmentform;
}
//below is form where it displays all of the text inputs and submit button
$editsession = "<form id='updateForm'>
<p><strong>Current Assessment's Date/Start Time:</strong></p>
<table>
<tr>
<th>Assessment:</th>
<td><input type='text' id='currentAssessment' name='Assessmentcurrent' readonly='readonly' value='' /> </td>
</tr>
<tr>
<th>Date:</th>
<td><input type='text' id='currentDate' name='Datecurrent' readonly='readonly' value='' /> </td>
</tr>
<tr>
<th>Start Time:</th>
<td><input type='text' id='currentTime' name='Timecurrent' readonly='readonly' value=''/> </td>
</tr>
</table>
<div id='currentAlert'></div>
<p><strong>New Assessment's Date/Start Time:</strong></p>
<table>
<tr>
<th>Assessment:</th>
<td><input type='text' id='newAssessment' name='Assessmentnew' readonly='readonly' value='' /> </td>
</tr>
<tr>
<th>Date:</th>
<td><input type='text' id='newDate' name='Datenew' readonly='readonly' value='' /> </td>
</tr>
<tr>
<th>Start Time:</th>
<td><input type='text' id='newTime' name='Timenew' readonly='readonly' value=''/><span class='timepicker_button_trigger'><img src='Images/clock.gif' alt='Choose Time' /></span> </td>
</tr>
</table>
<div id='datetimeAlert'></div>
</form>
<p><button id='updateSubmit'>Update Date/Start Time</button></p>
<div id='targetdiv'></div>
";
echo $editsession;
CSS:
form#assessmentForm {
float: left;
border: 1px solid red;
}
form#updateForm {
float:left;
clear: right;
/* with some space to the left of the second form */
margin-right: 100px;
}
p#submitupdatebtn {
clear: both;
}
目前,两种形式都显示在彼此之上。我真正想做的是显示$editsession
表单,显示$assessmentform
在右侧表单旁边,两个表单之间有一点空间。
如何做到这一点?我希望它适用于所有主要浏览器。
下面显示了合并在一起的两个屏幕截图,以显示我希望它如何显示:
谢谢
更新:
下面是它现在显示的内容: