2017-02-19 1 views
0

zurzeit <table> etwas wie verwende ich unterüber Tabelle HTML float links und immer oben

<table width="45%" bgcolor="#fff" border="0" style="float: left; margin:2px;"> 
    <tr> 
    <td><img src="img/default.jpg" style="width:170; height:auto;"></td> 
    </tr> 
</table> 

Das Problem ist: wie kann ich es mache immer an der Spitze, wie dieses Bild ohne Raum wie mein ersten Bild

Hier ist der Beispieltabelle von dem, was ich will:

Here the example table what i want

+0

Verwenden Sie eine Tabelle nicht, stattdessen Flexbox verwenden. – pol

Antwort

0

Sie können einfach zwei div s untereinander verwenden und für jede Zelle andere divs innerhalb der beiden Hauptdivs hinzufügen.

0

können Sie die „div“ -Tag verwenden, und das wird Ihre Tabelle auf jede beliebige Form teilen, die Sie wollen, und Sie werden es so machen: -

<div style="width:100px; height:auto; clear:both"> 

Ihr hier Eingang.

</div> 

, die zum Beispiel dann setzen Sie Ihre Kluft mit dem gleichen Format oben, aber den Stil und die klare Attribut wie das lassen, Dies wird Ihre Kluft getrennt und es wird nicht zu irgendeiner anderen teilen befestigen.

Ich hoffe, das wird funktionieren. :)

0
For placing table at the top use margin in css file set it 0 . 
    **margin: 0px;** 
See this example 

    <link rel="stylesheet" type="text/css" href="css/style.css"> 


<table border="1" class="myfirsttabel"> 

<thead> 

    <th>Name</th> 
    <th>Email</th> 
    <th>Mobileno</th> 


</thead> 


<tbody> 

<tr> 

<td> My Name is Varun</td> 
<td> My email id [email protected]</td> 
<td> My Mobile No is 8903527945 </td> 

</tr> 


<tr> 

<td>  
<table border="1" class="tabel"> 

<thead></thead> 

    <th>Name</th> 
    <th>Email</th> 
    <th>Mobileno</th> 


<tbody> 

<tr> 

<td> My Name is Varun</td> 
<td> My email id [email protected]</td> 
<td> My Mobile No is 8903527945 </td> 

</tr> 


<tr> 

<td>  

</td> 
<td> My email id [email protected]</td> 
<td> My Mobile No is 8903527945 </td> 

</tr> 


<tr> 

<td> My Name is Varun</td> 
<td> My email id [email protected]</td> 
<td> My Mobile No is 8903527945 </td> 

</tr> 


<tr> 

<td> My Name is Varun</td> 
<td> My email id [email protected]</td> 
<td> My Mobile No is 8903527945 </td> 

</tr> 
<tr> 

<td> new table</td> 
<td> My email id [email protected]</td> 
<td> My Mobile No is 8903527945 </td> 

</tr> 


<tr> 

<td> My Name is Varun</td> 
<td> My email id [email protected]</td> 
<td> My Mobile No is 8903527945 </td> 

</tr> 
</tbody> 

</table> 



</td> 
<td> My email id [email protected]</td> 
<td> My Mobile No is 8903527945 </td> 

</tr> 


<tr> 

<td> My Name is Varun</td> 
<td> My email id [email protected]</td> 
<td> My Mobile No is 8903527945 </td> 

</tr> 


<tr> 

<td> My Name is Varun</td> 
<td> My email id [email protected]</td> 
<td> My Mobile No is 8903527945 </td> 

</tr> 
</tbody> 

</table> 

enter image description here und CSS-Datei

Verwandte Themen