2016-08-01 9 views
0

Gibt es ein HTML-Attribut, das der CSS-Eigenschaft border-collapse: collapse; entspricht?border-collapse mit HTML-Attribut

Ich versuche, die gleiche 1px Rahmen nur mit HTML zu erreichen, und nicht mit CSS.

table{ 
 
    border-collapse: collapse; 
 
}
<table border="1px" cellpadding="3"> 
 
    <tr> 
 
<td>Row 1</td> 
 
<td>Row 1</td> 
 
<td>Row 1</td> 
 
    </tr> 
 
    <tr> 
 
<td>Row 2</td> 
 
<td>Row 2</td> 
 
<td>Row 2</td> 
 
    </tr> 
 
</table>

Antwort

0

könnten Sie cellspacing versuchen.

<table border="1px" cellspacing="0" cellpadding="3"> 
 
    <tr> 
 
<td>Row 1</td> 
 
<td>Row 1</td> 
 
<td>Row 1</td> 
 
    </tr> 
 
    <tr> 
 
<td>Row 2</td> 
 
<td>Row 2</td> 
 
<td>Row 2</td> 
 
    </tr> 
 
</table>

Anmerkung: Cellspacing keine Grenzen benachbarter Zellen überlappen, die CSS-Eigenschaft der Fall ist.

+0

w3chools gehen So ist es 'cellspacing' oder' cellspacing'? – Justinas

+0

@justinas Typo, Danke aber. – divy3993

+0

es ist nicht möglich, genau 1px Grenze nur mit HTML zu machen? –

0

können Sie cellspacing oder cellpadding verwenden, aber es ist veraltet in HTML5

+0

Ich konnte nicht 1px Rand mit Zellenabstand machen .. –

0

Ich verstehe nicht, warum Sie CSS aufhören wollen verwenden, weil das ist, was CSS tun können Sie die CSS Bootstrap ist im Inneren enthalten. für weitere Informationen

<div class="container"> 
    <h2>Basic Table</h2> 
    <p>The .table class adds basic styling (light padding and only horizontal dividers) to a table:</p> 
    <table class="table"> 
    <thead> 
     <tr> 
     <th>Firstname</th> 
     <th>Lastname</th> 
     <th>Email</th> 
     </tr> 
    </thead> 
    <tbody> 
     <tr> 
     <td>John</td> 
     <td>Doe</td> 
     <td>[email protected]</td> 
     </tr> 
     <tr> 
     <td>Mary</td> 
     <td>Moe</td> 
     <td>[email protected]</td> 
     </tr> 
     <tr> 
     <td>July</td> 
     <td>Dooley</td> 
     <td>[email protected]</td> 
     </tr> 
    </tbody> 
    </table> 
</div>