• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Abhänigkeit der Höhe von der Länge

CynnDiablo

Neues Mitglied
Guten Abend,

ich habe eine Hompage und möchte in diese eine Tabelle einfügen, das Problematische ist, das die Höhe immer gleich der Weite sein soll, wobei die Weite in % angegeben ist. Die Tabelle soll also mitwachsen, falls die Hompage sich verkleinert, die in der Tabelle befindlichen Bilder allerdings sollen nur verkleinert und nicht verzerrt oder abgeschnitten werden.

Hoffe jemand weiß rat
 
Werbung:
Das ist eine gute Frage!
Sowas ähnliches habe ich mich auch schonmal gefragt. Prinzipiell könnte man das ja per Javascript lösen, indem man - mega unprofessionell - ein setInterval oder sowas setzt, was in regelmäßigen Abständen die Höhe gleich der Weite der Tabelle setzt. Problem hierbei ist nur, dass ich nicht weiß, wie man an die vom Browser errechneten Stylewerte (hier für die Tabellenweite) rankommt!
Soll Deine Tabelle sich denn dynamisch verändern oder muss die Höhe nur am Anfang einmal gesetzt werden?

NobodyInPerson
 
also, das ist die Homepage http://tensho.funpic.de
der Informationsteil ist eingebunden durch einen php include script. Die Tabelle lässt sich wie ein Adventskalender mit quadratischen Türen vorstellen. Also dementsprechend sollen sie je nach größe der Homepage wachsen oder schrumpfen, allerdings immernoch quadratisch sein.
 
Werbung:
Hallo.

Also dir fehlt ein Doctype.
Du hast zwischen <html> und <head> Code stehen der da nicht hingehört.
Ebenso hast du zwischen </body> und </html> Code stehen der da nicht hingehört.

Ich empfehle dir erst mal die HTML Grundlagen zu lernen.
Danach noch CSS und kannst du auf Tabellen verzichten und bist deine Probleme los.

Gruss
Elroy
 
was gehört denn da nicht hin? Ich bin Html erst seit nem Monat am lernen und zwar schulisch. Die eigentliche Frage war aber doch, ob man eine Abhänigkeit der Größen einer Tabelle erreichen kann.
 
Hallo.

Ich habe mir das ganze noch mal genau aungesehen.
Das ist schlimmer als ich beim ersten mal gesehen habe.

Am besten du gibst bei Goggle HTML Grundgerüst ein.
Nachdem du das gelent hast fängst du noch mal ganz von vorne an.

Du hast Doctypes und Meta-Tags mitten in deinem Code stehen.
Du schliesst und öffnest <html> und <head> und <body> mehrmals in deinem Code als würde es keine HTML Standards geben.
Deine Style Angaben kommen noch bevor du den Head öffnest, du verwendest veraltete Auszeichnunge wie font face.

Hier ist das Ergebnis von W3C Validator.
Entferne bitte erst mal diese Fehler damit du einen sauberen Code hast.

Gruss
Elroy
 
Werbung:
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html" charset=iso-8859-1>
<style type="text/css">
    table{
    margin:0;
    padding:0;
}
body{
background-image:url("images/back.jpg");
background-attachment:fixed;
background-position:center;
}
</style> 

<head>
<title>Japan Ag</title>
</head>

<body bgcolor="#000000" background="images/back.jpg" text="#ffffff" link="#FFFFFF" alink="#FFFFFF" vlink="#FFFFFF"><font face="Arial">



<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
      <th scope="col" height="200">&nbsp;</th>
      <th scope="col" background="images/header2.png" style="background-position:center;" height="200"><a href="index.php"><img src="images/headerfront.png" alt="" border="0"></a></th>
      <th scope="col">&nbsp;</th>
  </tr>
  
  
  <tr>
    <th height="100%"  style="background-repeat: repeat; background-position:right;"  scope="col">&nbsp;</th>
    <th scope="col" width="80%" >

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"   style="background-repeat: repeat; background-position:left top;">
  <tr>
      <th scope="col" height="149" background="images/side-up.png"><img src="images/head1.png"  alt=""></th>
      <th scope="col">
    
    <table width="100%" height="149"  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <th width="100" scope="col" background="images/mid-top-left.png">&nbsp;</th>
          <th   scope="col" background="images/mid-top.png"><?php
    if(isset($_GET['site'])) 
    {
        switch($_GET['site']) 
        {
            case 'news' : include('news1.php'); break;
            case 'allg' : include('allg1.php'); break;
            case 'proj' : include('proj1.php'); break;
            case 'media' : include('media1.php'); break;
            case 'down' : include('down1.php'); break;
            case 'rpg' : include('rpg1.php'); break;
            case 'weiter' : include('weiter1.php'); break;
            case 'weiter' : include('weiter1.php'); break;
            case 'hainfo' : include ('down1.php') ; break;
            case '404' : include ('4041.php'); break;
            default : include('index1_1.php'); break;
        }
    }
    else 
    {
        include('index_2.php');
    }
 ?></th>
          <th  width="100"scope="col" background="images/mid-top-right.png">&nbsp;</th>
        </tr>
      </table>  
      </th>
  </tr>
  
  <tr >
    <th width="150" scope="col" valign="top" >
    <table width="100%" style="table-layout:fixed;" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <th width="100%" height="55" scope="col"background="images/side-mid.png"><a href="index.php?site=news">News</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" background="images/side-mid.png"><a href="index.php?site=allg">Allgemeines</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" background="images/side-mid.png"><a href="index.php?site=proj">Projekte</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" background="images/side-mid.png"><a href="index.php?site=media">Media</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" background="images/side-mid.png"><a href="index.php?site=down">Downloads</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" background="images/side-mid.png"><a href="index.php?site=rpg">RPG</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" background="images/side-mid.png"><a href="/forum">Forum</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" background="images/side-mid.png"><a href="http://www.mbgdierdorf.de/">MBG</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" background="images/side-low.png">&nbsp;</th>
  </tr>
  <tr>
    <th height="100%" scope="row">&nbsp;</th>
  </tr>
</table>
</th>
<th height="100%" align="top" valign="top" scope="col"  >                
    <table width="100%" height="550" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <th scope="col" width="100" background="images/mid-left.png">&nbsp;</th>
        <th scope="col" valign="top" background="images/mid.png"> <?php
    if(isset($_GET['site'])) 
    {
        switch($_GET['site']) 
        {
            case 'news' : include('news.php'); break;
            case 'allg' : include('allg.php'); break;
            case 'proj' : include('proj.php'); break;
            case 'media' : include('media.php'); break;
            case 'down' : include('down.php'); break;
            case 'rpg' : include('rpg.php'); break;
            case 'weiter' : include('weiter.php'); break;
            case 'weiter' : include('weiter.php'); break;
            case 'hainfo' : include ('datein/ha.html') ; break;
            case '404' : include ('404.php'); break;
            default : include('index1.php'); break;
        }
    }
    else 
    {
        include('index_1.php');
    }
 ?></th>
        <th scope="col" width="100" background="images/mid-right.png">&nbsp;</th>
      </tr>
    </table>
   
    </th>
  </tr>
</table>

</th>
    <th height="100%" style="background-repeat: repeat;" scope="col">&nbsp;</th>
  </tr>
  
    <tr>
      <th scope="col" height="100">&nbsp;</th>
      <th align="right" scope="col">
    <table width="100%" height="100" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <th width="150" height="38" scope="col" weight="150">&nbsp;</th>
          <th width="100" scope="col" background="images/mid-low-left.png" style="background-position:bottom" >&nbsp;</th>
          <th  scope="col" background="images/mid-low.png" style="background-position:bottom">&nbsp;</th>
          <th width="100" align="left" valign="bottom" background="images/mid-low-right.png" scope="col"  style="background-position:bottom" ><h6>&copy;by Cynthia Henkel</h6></th>
        </tr>
      </table>      
      </th>
      <th scope="col">&nbsp;</th>
  </tr>
  
</table>


</font>
</body>
</html>

das ist der code, ich finde nicht, das ich body und heads mehrmals durch die gegend werfe o_O
 
Sprichst Du von Japan Ag ?
Wenn ja dann ist das nicht der Quellcode. Der unter dieser URL fängt mit

HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<style type="text/css">
    table{
	margin:0;
	padding:0;
}
body{
background-image:url("images/back.jpg");
background-attachment:fixed;
background-position:center;
}
</style> 

<head>
<meta http-equiv="Content-Type" content="text/html" charset="iso-8859-1">
<title>Japan Ag</title>
</head>

<body bgcolor="#000000" background="images/back.jpg" text="#ffffff" link="#FFFFFF" alink="#FFFFFF" vlink="#FFFFFF"><!-- START --><noscript><div style="display:none">&nbsp;</div></noscript><script type="text/javascript" src="http://media.funpic.de/layer.php?bid=49085607"></script><!-- End -->
<iframe id='a395adda' name='a395adda' src='http://89.163.167.106/www/delivery/afr.php?zoneid=6&amp;cb=1292452504' frameborder='0' scrolling='no' width='1' height='1'><a href='http://89.163.167.106/www/delivery/ck.php?n=abba4863&amp;cb=1292452504' target='_blank'><img src='http://89.163.167.106/www/delivery/avw.php?zoneid=6&amp;cb=1292452504&amp;n=abba4863' border='0' alt='' /></a></iframe>
 <font face="Arial">

an und ist sehr fehlerhaft wie man sieht.
 
ich spreche von der japan ag, aber der code sieht nicht so aus wie du ihn gepostet hast T__T

hab ihn nochmal bearbeitet:
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
@import url("style.css");

    table{
    margin:0;
    padding:0;
}
</style> 

<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Japan Ag</title>
</head>

<body>
<div class="c1"> </div>


<table width="100%" border="0" cellpadding="0" cellspacing="0" >
  <tr>
      <th scope="col"  >&nbsp;</th>
      <th scope="col" height="200">
    <a href="index.php"><img src="images/headerfront.png" alt="" border="0" /></a>
    </th>
      <th scope="col">&nbsp;</th>
  </tr>
  
  
  <tr>
    <th height="100%" class="c3"  scope="col">&nbsp;</th>
    <th scope="col" width="80%" >

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="c5">
  <tr>
      <th class="c8"><img src="images/head1.png"  alt="" /></th>
      <th scope="col">
    
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <th width="100" scope="col" class="c9" height="149" >&nbsp;</th>
          <th   scope="col" class="d1"><?php
    if(isset($_GET['site'])) 
    {
        switch($_GET['site']) 
        {
            case 'news' : include('news1.php'); break;
            case 'allg' : include('allg1.php'); break;
            case 'proj' : include('proj1.php'); break;
            case 'media' : include('media1.php'); break;
            case 'down' : include('down1.php'); break;
            case 'rpg' : include('rpg1.php'); break;
            case 'weiter' : include('weiter1.php'); break;
            case 'weiter' : include('weiter1.php'); break;
            case 'hainfo' : include ('down1.php') ; break;
            case '404' : include ('4041.php'); break;
            default : include('index1_1.php'); break;
        }
    }
    else 
    {
        include('index_2.php');
    }
 ?></th>
          <th  width="100" scope="col" class="d2">&nbsp;</th>
        </tr>
      </table>  
      </th>
  </tr>
  
  <tr >
    <th width="150" scope="col" valign="top" >
    <table width="100%" class="c4" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <th width="100%" height="55" scope="col" class="d3"><a href="index.php?site=news">News</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" class="d3"><a href="index.php?site=allg">Allgemeines</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" class="d3"><a href="index.php?site=proj">Projekte</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" class="d3"><a href="index.php?site=media">Media</a></th>
  </tr>
  <tr> 
    <th height="55" scope="row" class="d3"><a href="index.php?site=down">Downloads</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" class="d3"><a href="index.php?site=rpg">RPG</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" class="d3"><a href="/forum">Forum</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" class="d3"><a href="http://www.mbgdierdorf.de/">MBG</a></th>
  </tr>
  <tr>
    <th height="55" scope="row" class="d4" ><blockquote>&nbsp;</blockquote></th>
  </tr>
  <tr>
    <th height="100%" scope="row">&nbsp;</th>
  </tr>
</table>
</th>
<th height="100%" valign="top" scope="col"  >                
    <table width="100%"  border="0" cellpadding="0" cellspacing="0">
      <tr>
        <th scope="col" height="550" width="100" class="d5">&nbsp;</th>
        <th scope="col" valign="top" class="d6"> <?php
    if(isset($_GET['site'])) 
    {
        switch($_GET['site']) 
        {
            case 'news' : include('news.php'); break;
            case 'allg' : include('allg.php'); break;
            case 'proj' : include('proj.php'); break;
            case 'media' : include('media.php'); break;
            case 'down' : include('down.php'); break;
            case 'rpg' : include('rpg.php'); break;
            case 'weiter' : include('weiter.php'); break;
            case 'weiter' : include('weiter.php'); break;
            case 'hainfo' : include ('datein/ha.html') ; break;
            case '404' : include ('404.php'); break;
            default : include('index1.php'); break;
        }
    }
    else 
    {
        include('index_1.php');
    }
 ?></th>
        <th scope="col" width="100" class="d7">&nbsp;</th>
      </tr>
    </table>
   
    </th>
  </tr>
</table>

</th>
    <th height="100%" class="c6" scope="col">&nbsp;</th>
  </tr>
  
    <tr>
      <th scope="col" height="100">&nbsp;</th>
      <th align="right" scope="col">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <th width="150" height="100" scope="col" >&nbsp;</th>
          <th width="100" scope="col" class="d8">&nbsp;</th>
          <th  scope="col" class="d9">&nbsp;</th>
          <th width="100" align="left" valign="bottom" class="e1" scope="col"><h6>&copy;by Cynthia Henkel</h6></th>
        </tr>
      </table>      
      </th>
      <th scope="col">&nbsp;</th>
  </tr>
  
</table>


</body>
</html>
Successfully Checked
http://validator.w3.org/check?uri=h...ine&group=1&st=1&user-agent=W3C_Validator/1.1
 
Zuletzt bearbeitet:
Werbung:
Zurück
Oben