好的,我已經做了一個聊天室,用戶在textarea中鍵入他的消息,然後將消息發送到php文件,在該文件中創建消息周圍的html,然後將其寫入名爲log.html的文件中。它還需要用戶用戶名和他的個人資料圖片。使用Divs或表格(tr,td)格式化聊天室?
所以以前我有我的代碼看起來像這樣:
<div class='msgln'>
<ul>
<li class='float'><img src='$someimg'></li>
<li class='username_chatroom'><b>username</b></li>
<li class='text_chatroom'><span class='text_span'>Random text</span><li>
</ul>
</div>
它使更多的意義轉換的div表TD,TR來進行簡單格式化?代碼會是這樣嗎? :
<tr class='tr_chat'>
<td class='img_chat'><img src='$someimg'></td>
<td class='usr_chat'><b>username</b></td>
<td class='msg_chat'>Text text text</td>
</tr>
唯一的其他問題的話,我有,當我創建在這個網站將是該文件,我需要定義表的末尾?因爲當我創建一個文件,我可以在beggining定義,但我不能結束它,因爲代碼會是這樣,那麼:
<table>
</table>
<tr class='tr_chat'>
<td class='img_chat'><img src='$someimg'></td>
<td class='usr_chat'><b>username</b></td>
<td class='msg_chat'>Text text text</td>
</tr>
那麼,是它更好地使用表代替的div進行格式化,如果所以..我需要定義一個表的結尾嗎?
**不要使用表佈局** –