|
Categorieën >
HTML & CSS
Link maken van een <tr> atribuut
|
|
|
offline
|
Lid
|
io,
Mijn vraag is of je van een <tr> attribuut in een tabel een link kan maken.
Wat mij logisch leek maar niet werkt was dit:
<table>
<a href='#'>
<tr>
<td>tekst:blabla</td>
<td>tekst:blabla</td>
</tr>
</a>
</table>
Maar dit werkt niet.
Weet iemand hoe je dit wel kan laten werken.
Met voorbaat dank,
Html_user |
4 antwoorden
|
|
|
offline
|
Lid
|
Goedenavond,
Voor hoever mijn bronnen gaan is het alleen maar mogelijk om het volgende te doen:
<td><a href="#">tekst:blabla</a></td>
<td><a href="#">tekst:blabla </a></td>
Ik hoop dat je er wat aan hebt waarvoor wil je het eigenlijk gebruiken?
Met Vriendelijke Groet,
Riagabel2
|
|
|
|
offline
|
Nieuw lid
|
<tr onClick="window.location.href='blabla.php'">...</tr>
<tr onClick="window.location.href='blabla.php'">... </tr>
|
|
|
|
offline
|
PHP expert
|
Of je doet iets met CSS, zodat de hyperlink de hele cel bestrijkt (met display: block):
<html>
<head>
<style type="text/css">
<!--
table.linktable { border: 1px solid #ff0000; margin: 0; padding: 0; }
table.linktable tr { border: 0; margin: 0; padding: 0; }
table.linktable tr td { width: 200px; height: 15px; line-height: 15px; border: 0; margin: 0; padding: 0; }
table.linktable tr td a { display: block; width: 100%; height: 100%; text-align: center; text-decoration: none; color: #cccccc; }
table.linktable tr td a:hover { background-color: #f0f0f0; color: #000000; }
//-->
</style>
</head>
<body>
<table class="linktable" cellspacing="0" cellpadding="0">
<tr>
<td><a href="#">cel een</a></td>
<td><a href="#">cel twee</a></td>
</tr>
</table>
</body>
</html>
<!-- table.linktable { border: 1px solid #ff0000; margin: 0; padding: 0; } table.linktable tr { border: 0; margin: 0; padding: 0; } table.linktable tr td { width: 200px; height: 15px; line-height: 15px; border: 0; margin: 0; padding: 0; } table.linktable tr td a { display: block; width: 100%; height: 100%; text-align: center; text-decoration: none; color: #cccccc; } table.linktable tr td a:hover { background-color: #f0f0f0; color: #000000; } //--> <table class="linktable" cellspacing="0" cellpadding="0"> <td><a href="#">cel een </a></td> <td><a href="#">cel twee </a></td>
Je kunt de stijl natuurlijk helemaal naar eigen smaak aanpassen.
|
|
|
|
offline
|

Erelid
|
Of je kan een colspan maken waar je 1 grote link hebt. Ik ben ook wel benieuwd waarvoor het gebruikt zal worden.
|
Je moet ingelogd zijn om een reactie te kunnen posten.
|
|
|