PDA

View Full Version : Possible inserting table in a div?


vellasilvan
01-17-2011, 11:07 AM
Hello I'm trying to insert a table in a div.
Can this be possible since the result is awful.
<div id="working_area"></div>
<table width="400" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td><strong>Contact Form </strong></td>
</tr>
</table>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td><form name="form1" method="post" action="send_contact.php">
<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td width="16%">Subject</td>
<td width="2%">:</td>
<td width="82%"><input name="subject" type="text" id="subject" size="50"></td>
</tr>
<tr>
<td>Detail</td>
<td>:</td>
<td><textarea name="message" cols="50" rows="4" id="message"></textarea></td>
</tr>
<tr>
<td>Name</td>
<td>:</td>
<td><input name="name" type="text" id="name" size="50"></td>
</tr>
<tr>
<td>Email</td>
<td>:</td>
<td><input name="customer_mail" type="text" id="customer_mail" size="50"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>Thank you

Corrosive
01-17-2011, 11:17 AM
Yes, of course you can put a table in a div, if you have some tabular data to display. Otherwise you are probably using the wrong tags.

gentleone
01-17-2011, 11:18 AM
Yes, no problem if you place the table in between the div tags, which you didn't. On a side note... using a table to layout a form is not really good practice.

domedia
01-17-2011, 12:49 PM
Just make sure you move the ending </div> to after the ending </table>

If it still looks bad, it's time to fire up some CSS to style those table cells 8)

.