iT邦幫忙

0

.sidenav a {
padding: 8px 8px 8px 32px;
text-decoration: none;
font-size: 25px;
color: #818181;
display: block;
transition: 0.3s;
}

.sidenav a:hover {
color: #f1f1f1;
}

.sidenav .closebtn {
position: absolute;
top: 0;
right: 25px;
font-size: 36px;
margin-left: 50px;
}

@media screen and (max-height: 450px) {
.sidenav {padding-top: 15px;}
.sidenav a {font-size: 18px;}
}

<style type="text/css">

.droptarget1 {
float: left;
width: 690px;
height: 3550px;
margin: 15px;
padding: 10px;
border: 1px solid #aaaaaa;
}

<div class="droptarget1" ondragover="allowDrop(event)" ondrop="drop(event)">

  &nbsp; &nbsp; 課程編號&nbsp; &nbsp; &nbsp; 開課班次&nbsp; &nbsp; &nbsp; 課程名稱&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 學分&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;鐘點數&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;必選修
  <p draggable="true" id="dragtarget" ondragend="dragEnd(event)" ondragstart="dragStart(event)">
  <?php
  

include("mysql_connect.inc.php");
//此判斷為判定觀看此頁有沒有權限
//說不定是路人或不相關的使用者
//因此要給予排除
if($_SESSION['course_administrator_account'] != null)
{

    //將資料庫裡的所有會員資料顯示在畫面上
    $sql = "SELECT * FROM syllabus_table";
    $result = mysql_query($sql);
    while($row = mysql_fetch_row($result))
    {
             echo " $row[0] " . 
             "<br>";
    }

}

?>



請選擇志願順序
    課程編號      開課班次      課程名稱                學分                 鐘點數               必選修 

<script>

function dragStart(event) {
event.dataTransfer.setData("Text", event.target.id);
document.getElementById("demo").innerHTML = "新增課程";
}

function dragEnd(event) {
document.getElementById("demo").innerHTML = "已成功新增";
}

function allowDrop(event) {
event.preventDefault();
}

function drop(event) {
event.preventDefault();
var data = event.dataTransfer.getData("Text");
event.target.appendChild(document.getElementById(data));
}

請教一下怎麼把由直的資料改成橫的 感謝

ice bear iT邦新手 5 級 ‧ 2020-06-01 12:58:42 檢舉
建議你 可以把程式碼整理好,然後說一下你預期的結果跟你現在跑出來的結果
其實有點看不懂你要問什麼@@

尚未有邦友回答

立即登入回答