Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Tabellenrahmen

Empfohlene Antworten

Veröffentlicht

Hallo,

Ich möchte auf einer HTML-Seite eine Tabelle ausgeben, und zwar soll in der Kopf- und in der Fußzeile jede Zelle vollständig umrahmt sein, der Tabellenkörper soll jedoch gar keinen Rahmen haben.

Bisher hab ich das auf 3 Tabellen aufgeteilt, was jedoch immer wieder zu Problemen mit der Ausrichtung führt.

Hat jemand eine Idee, wie man das in einer Tabelle machen könnte?

Mit Jscript vielleicht?

Probier mal den Code:

<html>

<head>

<style type="text/css">

#links {

  border-left-width:1cm;

  border-left-style:solid;

  border-color:red;

  padding-left:1cm;

  text-align:justify; }

#linksrechts {

  border-left-width:1cm;

  border-left-style:solid;

  border-left-color:red;

  padding-left:1cm;

  border-right-width:1cm;

  border-right-style:solid;

  border-right-color:green;

  padding-right:1cm;

  text-align:justify; }

#rundrum {

  border-width:1px;

  border-style:solid;

  border-color:blue;

  padding:1cm;

  text-align:justify; }

}

</style>

</head>

<body>

<table width=100% >

 <tr>

  <td><p id="links"> 1</p></td>

 </tr>

 <tr >

  <td><p id="linksrechts"> 2</p></td>

 </tr>

 <tr>

  <td><p  id="rundrum"> 3</p></td>

 </tr>

</table>

</body>

</html>

hmm ich bin jetzt zu faul zum testen.. daher nur ne ideen...

vielleicht steht hier auch was http://de.selfhtml.org/css/eigenschaften/tabellen.htm#border_collapse ...

die idee wäre das du bei dem obersten und dem untersten <td> einfach direkt nen style reinmachst :)

also sowas hier <td style="border: solid; border-width=1px">kopfzeile</td>

könnte mir vorstellen das das klappt :)

edit: vertippser..

das von meinem vorredner sollte auch klappen bloss das da halt der ganze tabellenkörper links und rechts nochn rand hat :D

Das hier funzt auch wie garret gesagt hat!


<html>

<head>

</head>

<body>

<table style="border:2px solid black" width=100%>

 <tr  style="border:2px solid black">

  <td style="border:1px solid black">hallo</td>

 </tr>

 <tr >

  <td style="border:1px solid grey; border-color:#AAFFAA; border-width=4px"><p id="linksrechts"> 2</p></td>

 </tr>

 <tr>

  <td>3</td>

 </tr>

</table>

</body>

</html>

edit: das style in <tr> hat keinen Effekt (zumindest bei meinem IE)

Vielleicht weiß ja einer, warum das so ist?

du könntest auch mit thead tbody und tfoot arbeiten:


<table class="content">

<thead>

<tr><td>KOPFZEILE</td></tr>

</thead>

<tfoot>

<tr><td>FUSSZEILE</td></tr>

</tfoot>

<tbody>

<tr><td>BODY</td></tr>

</tbody>

</table>

per css dann formatieren:

.content thead {

  /*formatierungen des thead*/

}

.content tbody {

  /*formatierungen des tbody*/

}

.content tfoot {

  /*formatierungen des tfoot*/

}

weitere wichtige dinge mit thead tfoot und tbody zu arbeiten gibts bei selfhtml.

http://de.selfhtml.org/html/tabellen/aufbau.htm#kopf_koerper_fuss

z.b. ist darauf zu achten, dass immer zuerst der "thead" dann der "tfoot" und danach erst n-man der "tbody" kommt

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.