Martin: Tabellen mit colspan und rowspan

Hallo,

ich habe folgende Tabelle gebastelt. Sie sieht auch so aus, wie ich sie haben will. Doch die Zelle 4 soll wegen rowspan=2 länger sein als Zelle 7, ist sie aber nicht. Kann mir jemand sagen, wo das Problem liegen könnte.

Danke

Martin

<html>
<head>
<title></title>
<meta name="author" content="Martin Meyer">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
</head>
<body >

<table border="1" height="401" width="750">

<tr height="1" valign="middle" align="center">
 <td width="100" colspan="1" rowspan="1"></td>
 <td width="20" colspan="1" rowspan="1"></td>
 <td width="530" colspan="1" rowspan="1"></td>
 <td width="100" colspan="1" rowspan="1"></td>
</tr>

<tr valign="middle" height="100" align="center">
 <td width="100" colspan="1" rowspan="1">1</td>
 <td width="550" colspan="2" rowspan="1">2</td>
 <td width="100" colspan="1" rowspan="1">3</td>
</tr>

<tr valign="middle" height="20" align="center">
 <td width="100" colspan="1" rowspan="2">4</td>
 <td width="20" colspan="1" rowspan="1">5</td>
 <td width="630" colspan="2" rowspan="1">6</td>
</tr>

<tr valign="middle" height="180" align="center">
 <td width="20" colspan="1" rowspan="2">8</td>
 <td width="630" colspan="2" rowspan="2">9</td>
</tr>

<tr valign="middle" height="100" align="center">
 <td width="100"  colspan="1" rowspan="1">8</td>
</tr>

</table>
</body>
</html>

  1. Hi, ich würde gerne helfen aber versteh ich nicht genau wo das Problem liegt.

    Eine Zelle 7 konnte ich auch nicht finden, dafür 2mal Zelle 8 ;)

    Kannst Du das vielleicht mal skizzieren oder ähnlich wie es denn aussehen soll? Vielleicht bin ich auch zu dumm und versteh die Frage nur nicht :P

    Kermet

  2. Hi,
    eigentlich sollte sowas bei rauskommen:

    +---+--+--------------+---+
    +---+--+--------------+---+
    +---+-----------------+---+
        +--+------------------+
    +---+  +                  +
    +---+--+------------------+

    oder?

    Grüße
    Heike

    1. Hi,
      eigentlich sollte sowas bei rauskommen:

      +---+--+--------------+---+
      +---+--+--------------+---+
      +---+-----------------+---+
          +--+------------------+
      +---+  +                  +
      +---+--+------------------+

      oder?

      Grüße
      Heike

      Hi,

      eigentlich ja, aber schau dir mal den Eintrag über dir an, da habe ich nochmal geschrieben, wie es aussieht und wie es aussehen soll.

      CU

  3. Oh sorry,

    die untere Zelle 8 ist die Zelle 7.
    Die Tabelle soll ungefähr so aussehen

    +---+---------+---+

    • 1 +    2    + 3 +
      +---+-------------+
      +   + 5+     6    +
      +   +--+----------+
    • 4 +  +          +
      +   + 8+          +
      +---+  +   9      +
    • 7 +  +          +
      +---+-------------+

    Sie sieht aber so aus

    +---+---------+---+

    • 1 +    2    + 3 +
      +---+-------------+
      +   + 5+     6    +
    • 4 +--+----------+
      +---+  +          +
      +   + 8+          +
    • 7 +  +   9      +
      +   +  +          +
      +---+-------------+
    1. Hallo Martin

      Woher soll die Zelle 4 wissen, wie hoch sie sein soll?
      Du hast die erste Row zur Definition der Breiten gemacht. Genaus so solltest du die erste Column zur Definition der Höhen machen. D.h. jeweils eine <td></td> pro row dazu, in der du die Höhe definierst. Und nimm die Höhe aus dem <tr> raus, ist nicht korrekt.

      Ungefähr so:
      <table border="1" height="401" width="750">
       <tr height="1" valign="middle" align="center">
        <td width="1"></td>
        <td width="100" colspan="1" rowspan="1"></td>
        <td width="20" colspan="1" rowspan="1"></td>
        <td width="530" colspan="1" rowspan="1"></td>
        <td width="100" colspan="1" rowspan="1"></td>
       </tr>
       <tr valign="middle" align="center">
        <td height="100"></td>
        <td width="100" colspan="1" rowspan="1">1</td>
        <td width="550" colspan="2" rowspan="1">2</td>
        <td width="100" colspan="1" rowspan="1">3</td>
       </tr>
       <tr valign="middle" align="center">
        <td height="20"></td>
        <td width="100" colspan="1" rowspan="2">4</td>
        <td width="20" colspan="1" rowspan="1">5</td>
        <td width="630" colspan="2" rowspan="1">6</td>
       </tr>
       <tr valign="middle" align="center">
        <td height="180"></td>
        <td width="20" colspan="1" rowspan="2">8</td>
        <td width="630" colspan="2" rowspan="2">9</td>
       </tr>
       <tr valign="middle" align="center">
        <td height="100"></td>
        <td width="100"  colspan="1" rowspan="1">7</td>
       </tr>
      </table>

      Gruss
      Ursula

      1. Danke,

        hat funktioniert.

        CU

        Martin

        Hallo Martin

        Woher soll die Zelle 4 wissen, wie hoch sie sein soll?
        Du hast die erste Row zur Definition der Breiten gemacht. Genaus so solltest du die erste Column zur Definition der Höhen machen. D.h. jeweils eine <td></td> pro row dazu, in der du die Höhe definierst. Und nimm die Höhe aus dem <tr> raus, ist nicht korrekt.

        Ungefähr so:
        <table border="1" height="401" width="750">
        <tr height="1" valign="middle" align="center">
          <td width="1"></td>
          <td width="100" colspan="1" rowspan="1"></td>
          <td width="20" colspan="1" rowspan="1"></td>
          <td width="530" colspan="1" rowspan="1"></td>
          <td width="100" colspan="1" rowspan="1"></td>
        </tr>
        <tr valign="middle" align="center">
          <td height="100"></td>
          <td width="100" colspan="1" rowspan="1">1</td>
          <td width="550" colspan="2" rowspan="1">2</td>
          <td width="100" colspan="1" rowspan="1">3</td>
        </tr>
        <tr valign="middle" align="center">
          <td height="20"></td>
          <td width="100" colspan="1" rowspan="2">4</td>
          <td width="20" colspan="1" rowspan="1">5</td>
          <td width="630" colspan="2" rowspan="1">6</td>
        </tr>
        <tr valign="middle" align="center">
          <td height="180"></td>
          <td width="20" colspan="1" rowspan="2">8</td>
          <td width="630" colspan="2" rowspan="2">9</td>
        </tr>
        <tr valign="middle" align="center">
          <td height="100"></td>
          <td width="100"  colspan="1" rowspan="1">7</td>
        </tr>
        </table>

        Gruss
        Ursula