Jump to content

Is this how CSS is meant to behave? Floating tables.


cs.punk

Recommended Posts

Sorry guys..

 

CSS

.div1 {
border: solid 2px #CC6644;
float: left;
}

table {
float: left;
}

 

XHTML

<div class='div1'>
<p>test test test </p>
</div>

<table border='1'>
<tr>
 <th>Title</th>
 <th>Test</th>
</tr>
<tr>
 <td>test test test test test test test test test test test test test test test test test 
	 test test test test test test test test test test test test test test test test 
	 test test test test test test test test test test test test test test test test
</td>
 <td>2</td>

</tr>
</table>

 

With this code the table does not 'float against' div1 (fig 1) ONLY once I remove the float from table* does it float normally (fig 2).

 

*

table {

}

This happens in firefox, in IE it works perfectly.

 

[attachment deleted by admin]

just tested and it does float. if u dont set a width how will u know if it is floating or not lol

 

<style type="text/css">
.div1 {
border: solid 2px #ff0000;
float: left;
margin:10px;
}

table {
float: left;
width:600px;
color:#ff0000;
}

</style>
<div class='div1'>
<p>test test test </p>
</div>

<table border='1'>
<tr>
 <th>Title</th>
 <th>Test</th>
</tr>
<tr>
 <td>test test test test test test test test test test test test test test test test test 
	 test test test test test test test test test test test test test test test test 
	 test test test test test test test test test test test test test test test test
</td>
 <td>2</td>

</tr>
</table>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.