Archivlink: javarea.de Forum > (X)HTML & CSS (allgemein) > Tabelle fix trotz %-Angabe - bitte wie mache ich das?
Vollständigen Link anzeigen: javarea.de Forum > (X)HTML & CSS (allgemein) > Tabelle fix trotz %-Angabe - bitte wie mache ich das?

Pages: [1]

geschrieben von Cluster am 13.03.2005 - 20:33
Hallöchen!

Ich habe folgendes Problem und leider noch keine fertige Seite und URL, aber ich hoffe, Ihr könnt mir trotzdem helfen.

Folgendes Problem:

ich habe einen <div>, welcher eine Weite von 15% hat. In diesem befindet sich meine Navi, welche über Tabellen realisiert wird. Diese Tabellen sind mit 100% bestimmt und darunter wiederum eine Ebene mit Tabellen, welche mit 98% bestimmt sind.

Diese 98%-igen Tabellen sollen beim hover mitttels Javascript auf 100% aufgezogen werden und somit die Größe der Überschriftstabelle annehmen.

Benutze ich feste Weitenangaben, haut alles einwandfrei hin. Benutze ich allerdings %-Angaben, nimmt die Zelle die Größe des Inhalts an und maximal halt die 98%. Habe ich nun allerdings einen Textinhalt, welcher unter 98% liegt, macht er mir auch die Tabelle entsprechend kleiner.

Dieses möchte ich allerdings vermeiden und von daher meine Frage:

- kann ich unabhängig vom Inhalt der Tabelle diese mittels %-Angaben immer auf 98% festlegen? Wenn ja, wie läuft das bitte mittels CSS?

Bin Euch für Eure Hilfe wie immer im voraus dankbar.

geschrieben von okley am 13.03.2005 - 20:46
am besten posted du uns deinen code

geschrieben von Cluster am 13.03.2005 - 20:56
Ok, mal schnell was gecoded:
HTML-Quelltext
1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
28: 
29: 
30: 
31: 
32: 
33: 
34: 
35: 
<head>
<title></title>
</head>
<body>
<script type=text/javascript>
<!--
function MouseOver(obj)
{obj.style.backgroundColor='#FFFFE1'; obj.style.width='100%'; obj.style.height='16';obj.style.cursor='hand'; obj.style.fontWeight='bold'; obj.style.fontSize='8pt';}
function MouseOut(obj)
{obj.style.backgroundColor='#ffefde'; obj.style.width='98%'; obj.style.fontWeight='normal'; obj.style.fontSize='10pt';}
//-->
</script>
<div style="width:15%; position:relative; border:1px solid #000000;">
<table align="left" width=100% border=0>
<tr><th>
   <table><tr><th height="5px"></th></tr></table>
   <table width="100%">
   <tr><th><span>Klosterfelde</span></th></tr>
   </table>
      <table width="98%">
      <tr><td width="98%" onMouseOver="MouseOver(this)"; onMouseOut="MouseOut(this)"; onclick="location.href='#'; return true;"><span class="menu"><font size="1">&nbsp;<b>»</b></font><a> Aktuelles</a></span></td></tr>
      </table>
      <table>
      <tr><td  width="98%" onMouseOver="MouseOver(this)"; onMouseOut="MouseOut(this)"; onclick="location.href='#'; return true;"><span class="menu"><font size="1">&nbsp;<b>»</b></font> Gruppen</span></td></tr>
      </table>
      <table>
      <tr><td  width="98%" onMouseOver="MouseOver(this)"; onMouseOut="MouseOut(this)"; onclick="location.href='#'; return true;"><span class="menu"><font size="1">&nbsp;<b>»</b></font> &Uuml;ber uns</span></td></tr>
      </table>
      <table>
      <tr><td  width="98%" onMouseOver="MouseOver(this)"; onMouseOut="MouseOut(this)"; onclick="location.href='#'; return true;"><span class="menu"><font size="1">&nbsp;<b>»</b></font> Kontakt</span></td></tr>
      </table>
</th></tr>
</table>
</div>
</body>


Powered by: JBB v.2.0.4 Copyright ©2000-2006, www.javarea.de.