Ankündigung

Einklappen
Keine Ankündigung bisher.

Tabellen Problem

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Tabellen Problem

    Hallo,

    ich habe diesen Code:
    PHP-Code:
    <table width="500" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0">
      <
    tr>
        <
    td colspan="2"></td>
      </
    tr>
      <
    tr>
        <
    td></td>
        <
    td></td>
      </
    tr>
      <
    tr>
        <
    td></td>
        <
    td></td>
      </
    tr>
      <
    tr>
        <
    td colspan="2"></td>
      </
    tr>
      <
    tr>
        <
    td></td>
        <
    td></td>
      </
    tr>
      <
    tr>
        <
    td></td>
        <
    td></td>
      </
    tr>
    </
    table> 
    Die Ausgabe sieht so aus:


    Nun möchte ich es mit HTML realisieren können, dass die Tabelle so aussieht:

    (Diese Tabelle habe ich mit MS Word gemacht)


    Kann mir jemand helfen

  • #2
    würde den border mit css angeben:

    Code:
    <table style="border: 1px; border-color: #000000">
    **deine reihen und spalten aufteilung**
    sollte funktionieren. und da du dann eh schon mit css arbeitest, kannst du die größenangaben auch direkt mit reinpacken

    mfg
    Baltasar

    Kommentar


    • #3
      Das hatte ich vorher ja auch schon versucht, aber bei mir wird dann garkein border angezeigt.

      Kommentar


      • #4
        ok..dann mach das anders. ist zwar ne an sich beknackte mischung aus html und css, aber funzt ganz sicher...(hab ich ne weile auch so gemacht)

        Code:
        <table border="1" bordercolor="black" style="border: 0px;">
        deine aufteilung
        </table>
        das bewirkt nämlich, dass nur die zellen umrandet werden und nicht noch zusätzlich die ganze tabelle.

        Kommentar


        • #5
          ICh habe jetzt eine andere Lösung gefunden:

          PHP-Code:
          <table width="500" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0">
          <
          tr> 
          <
          td colspan="2" style="border-right: #000000 0px solid; border-top: #000000 0px solid; border-left: #000000 0px solid; border-bottom: #000000 1px solid; "></td> 
          </
          tr> 
          <
          tr> 
          <
          td style="border-right: #000000 1px solid; border-top: #000000 0px solid; border-left: #000000 0px solid; border-bottom: #000000 1px solid; "></td> 
          <
          td style="border-right: #000000 0px solid; border-top: #000000 0px solid; border-left: #000000 0px solid; border-bottom: #000000 1px solid; "></td> 
          </
          tr> 
          <
          tr> 
          <
          td style="border-right: #000000 1px solid; border-top: #000000 0px solid; border-left: #000000 0px solid; border-bottom: #000000 1px solid; "></td> 
          <
          td style="border-right: #000000 0px solid; border-top: #000000 0px solid; border-left: #000000 0px solid; border-bottom: #000000 1px solid; "></td> 
          </
          tr> 
          <
          tr> 
          <
          td colspan="2" style="border-right: #000000 0px solid; border-top: #000000 0px solid; border-left: #000000 0px solid; border-bottom: #000000 1px solid; "></td> 
          </
          tr> 
          <
          tr> 
          <
          td style="border-right: #000000 1px solid; border-top: #000000 0px solid; border-left: #000000 0px solid; border-bottom: #000000 1px solid; "></td> 
          <
          td style="border-right: #000000 0px solid; border-top: #000000 0px solid; border-left: #000000 0px solid; border-bottom: #000000 1px solid; "></td> 
          </
          tr> 
          <
          tr> 
          <
          td style="border-right: #000000 1px solid; border-top: #000000 0px solid; border-left: #000000 0px solid; border-bottom: #000000 0px solid; "></td> 
          <
          td style="border-right: #000000 0px solid; border-top: #000000 0px solid; border-left: #000000 0px solid; border-bottom: #000000 0px solid; "></td> 
          </
          tr> 
          </
          table> 

          Kommentar


          • #6
            Du könntest es auch auslagern und die jeweiligen CSS-Formatierungen dann später leichter anpassen - angenehmer Nebeneffekt sollte eine verbesserte Übersichtlichkeit sein.

            PHP-Code:
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
            <
            html>
            <
            head>
            <
            title>Eine Tabelle mit CSS-Border</title>
            <
            meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
            <
            style type="text/css" media="screen">
            <!--
            table
                
            {
                 
            border:1px solid #000;
                
            }
            .
            tdone
                
            {
                 
            border-width:0px 1px 1px 0px; /* top right bottom left */
                 
            border-style:solid;
                 
            border-color:#000 #000 #000 #000;
                
            }

            .
            tdtwo
                
            {
                 
            border-width:0px 0px 1px 0px;
                 
            border-style:solid;
                 
            border-color:#000 #000 #000 #000;
                
            }
            .
            tdthree
                
            {
                 
            border-width:0px 1px 0px 0px;
                 
            border-style:solid;
                 
            border-color:#000 #000 #000 #000;
                
            }
            .
            tdfour
                
            {
                 
            border:none;
                }
            -->
            </
            style>
            </
            head>

            <
            body>
            <
            table width="500" border="0" bordercolor="#000000" cellpadding="2" cellspacing="0">
            <
            tr>
            <
            td colspan="2" class="tdtwo"></td>
            </
            tr>
            <
            tr>
            <
            td class="tdone"></td>
            <
            td class="tdtwo"></td>
            </
            tr>
            <
            tr>
            <
            td class="tdone"></td>
            <
            td class="tdtwo"></td>
            </
            tr>
            <
            tr>
            <
            td colspan="2" class="tdtwo"></td>
            </
            tr>
            <
            tr>
            <
            td class="tdone"></td>
            <
            td class="tdtwo"></td>
            </
            tr>
            <
            tr>
            <
            td class="tdthree"></td>
            <
            td class="tdfour"></td>
            </
            tr>
            </
            table>

            </
            body>
            </
            html> 

            Kommentar


            • #7
              Du könntest es auch auslagern und die jeweiligen CSS-Formatierungen dann später leichter anpassen - angenehmer Nebeneffekt sollte eine verbesserte Übersichtlichkeit sein.
              Ich weiss ...

              Kommentar


              • #8
                Zitat von Corvin Gröning
                Du könntest es auch auslagern und die jeweiligen CSS-Formatierungen dann später leichter anpassen - angenehmer Nebeneffekt sollte eine verbesserte Übersichtlichkeit sein.
                Ich weiss ...
                Wollte auch nix unterstellen
                Sah in der C&P-Version nur so wüst aus :P

                Kommentar


                • #9
                  Sah in der C&P-Version nur so wüst aus
                  Stimmt, war ja auch erstmal nur die schnelle Version zum Testen

                  Kommentar


                  • #10
                    Warum eigentlich so umständlich?
                    border-collapse heisst das Zauberwort
                    Code:
                    <html>
                    <head>
                    <style type="text/css">
                    table { border:0;border-collapse:collapse; }
                    td { border:1px solid #000000; }
                    </style>
                    </head>
                    <table width="500" cellpadding="2" cellspacing="0">
                    <tr>
                    <td colspan="2"></td>
                    </tr>
                    <tr>
                    <td></td>
                    <td></td>
                    </tr>
                    <tr>
                    <td></td>
                    <td></td>
                    </tr>
                    </table>
                    </body>
                    </html>

                    Kommentar

                    Lädt...
                    X