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.

Hintergrundbild für <td>`s

Empfohlene Antworten

Veröffentlicht

Hi Leute,

ich hab mal wieder ein kleines Prob. Ich habe ein JavaScript erstellt welches mir eine komplette Tabelle zusammensetzt. Nun möchte ich den <td>`s ein Hintergrundbild verpassen. Leider funzt das nicht so wie ich will, naja er zeigt halt nichts an.

Hier die Codeteile:

eleTable1=document.createElement("table");

document.body.appendChild(eleTable1);

eleTr1[1]=eleTable1.insertRow(0);

eleTd1[1] = document.createElement("td");

eleTd1[1].backgroundImage="url(test.jpg)"; -> keine Anzeige

//eleTd1[1].backgroundImage="url('test.jpg')"; -> keine Anzeige

//eleTd1[1].backgroundImage="test.jpg"; -> keine Anzeige

//eleTd1[1].style.backgroundImage="test.jpg"; -> Fehlermeldung

eleTr1[1].appendChild(eleTd1[1]);

Ich kann mit der <td> ansonsten alles machen nur das Hintergrundbild bekomm ich nicht hin.

Habt ihr eine Idee?

Thx

Danke...

Die Syntax ist zwar richtig aber der IE macht mal wieder Probleme. Problem ist unterm IE, dass er es nicht anzeigt sobald ein JPG angezeigt werden soll. Unter Firefox z.B. wird es ohne Probleme angezeigt. Sobald ich anstatt dem JPG ein GIF oder PNG nehme funktioniert es auch im IE.

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.