CSS margin-innen Tabelle

Ich versuche nicht mit Glück anwenden rechten Rand innerhalb von Tabellen

<html>
  <style>
    input,select {
      width: 100%;
      margin-right: 15px;
      background: red;
    }
  </style>
  <body>
    <table border="2" color="red" width="100%">
       <tr>
         <td width="25%"><input type="text" /></td>
         <td width="25%"><select><option>foobar</option></select></td>
         <td width="25%"><input type="text" /></td>
         <td width="25%"><input type="text" /></td>
       </tr>
       <tr>
         <td width="25%"><input type="text" /></td>
         <td width="25%"><input type="text" /></td>
         <td width="25%"><select><option>foobar</option></select></td>
         <td width="25%"><input type="text" /></td>
       </tr>
    <table>
  </body>
</html>

Beispiel: http://jsfiddle.net/3reat/

Nur mit CSS ist es möglich, zu definieren, diese Ränder 100% - 15px?

@Edit

Gelöst mit width: calc(100% - 15px) CSS3 Antwort von @TamilSelvan mit Räume

http://jsfiddle.net/3reat/2/

  • versuchen Sie, css3 calc (e.g) margin -: calc(100%-15px)
  • Wo musst du noch margin/padding? Aus der Tabelle außerhalb? Tabelle drin? Zellen? Ein bisschen genauer bitte.
  • danke!!! Erstellen Sie eine Antwort, als ich akzeptieren.
  • Wenn calc() ist ok für Sie, dann verwenden Sie es in der richtigen Weise, mit Leerzeichen: calc(100% - 15%).
  • Ja. Mit Leerzeichen!
InformationsquelleAutor Ragen Dazs | 2013-04-13
Schreibe einen Kommentar