Table borders
Is het mogelijk om bij een tabel alleen de onderste border-lijn zichtbaar te maken ? Zo ja, op welke manier?
Ik probeer op verschillende manieren toe te voegen aan een <TR>. Het is de bedoeling dat er onder elke row een horizontale streep komt. Er worden gegevens gehaald uit een database waaruit de lijst is ontstaan.
Zie hieronder de totale code:
Zie hieronder de totale code:
Code (php)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
ini_set('display_errors', 1); // 0 = uit, 1 = aan
error_reporting(E_ALL);
//includes
include('config.php');
include('dbcon.php');
echo '<b>Interne nummers op naam</b><br>';
// onderstaand de query
$query = mysql_query("SELECT naam, nummer, inlog, afdeling, groep FROM intern ORDER BY naam ASC");
// array vullen met resultaten
$array = array();
while($array[] = mysql_fetch_array( $query ));
// aantal kolommen die je wilt hebben
$kolommen = 2;
// dit is mysql_num_rows()
$max = mysql_num_rows($query);;
// aantal uitgerekende rijen
//$stap = ceil($max / $kolommen);
// vast aantal rijen
$stap = 78;
echo '<table BORDER="0" ALIGN="left" STYLE="font-size: 5.5pt;">
<td width="100"><b>Naam</b></td>
<td width="10"><b>Telnr.</b></td>
<td width="10"><b>Inlog</b></td>
<td width="150"><b>Afdeling</b></td>
<td width="10"><b>Groep</b></td>
<td width="5"></td>
<td width="100"><b>Naam</b></td>
<td width="10"><b>Telnr.</b></td>
<td width="10"><b>Inlog</b></td>
<td width="150"><b>Afdeling</b></td>
<td width="10"><b>Groep</b></td>
</tr>';
for($i=0; $i<$stap; $i++)
{
echo '<tr STYLE="font-size: 5.5pt; border-bottom: 1px black dotted;">';
for($j=0; $j<$kolommen; $j++)
{
if(($i + ($j * $stap)) < $max)
{
// hier moet je fetchen en de data neerzetten
$row2 = $array[$i + ($j * $stap)];
echo '<td width="100">' . $row2['naam'] . '</td>';
echo '<td width="10">' . $row2['nummer'] . '</td>';
echo '<td width="10">' . $row2['inlog'] . '</td>';
echo '<td width="150">' . $row2['afdeling'] . '</td>';
echo '<td width="10">' . $row2['groep'] . '</td>';
echo'<td width="5"></td>';
}
else
{
echo '<td width="100"> </td>';
echo '<td width="10"> </td>';
echo '<td width="10"> </td>';
echo '<td width="150"> </td>';
echo '<td width="10"> </td>';
echo'<td width="5"></td>';
}
}
echo '</tr>';
}
echo '</table>';
?>
ini_set('display_errors', 1); // 0 = uit, 1 = aan
error_reporting(E_ALL);
//includes
include('config.php');
include('dbcon.php');
echo '<b>Interne nummers op naam</b><br>';
// onderstaand de query
$query = mysql_query("SELECT naam, nummer, inlog, afdeling, groep FROM intern ORDER BY naam ASC");
// array vullen met resultaten
$array = array();
while($array[] = mysql_fetch_array( $query ));
// aantal kolommen die je wilt hebben
$kolommen = 2;
// dit is mysql_num_rows()
$max = mysql_num_rows($query);;
// aantal uitgerekende rijen
//$stap = ceil($max / $kolommen);
// vast aantal rijen
$stap = 78;
echo '<table BORDER="0" ALIGN="left" STYLE="font-size: 5.5pt;">
<td width="100"><b>Naam</b></td>
<td width="10"><b>Telnr.</b></td>
<td width="10"><b>Inlog</b></td>
<td width="150"><b>Afdeling</b></td>
<td width="10"><b>Groep</b></td>
<td width="5"></td>
<td width="100"><b>Naam</b></td>
<td width="10"><b>Telnr.</b></td>
<td width="10"><b>Inlog</b></td>
<td width="150"><b>Afdeling</b></td>
<td width="10"><b>Groep</b></td>
</tr>';
for($i=0; $i<$stap; $i++)
{
echo '<tr STYLE="font-size: 5.5pt; border-bottom: 1px black dotted;">';
for($j=0; $j<$kolommen; $j++)
{
if(($i + ($j * $stap)) < $max)
{
// hier moet je fetchen en de data neerzetten
$row2 = $array[$i + ($j * $stap)];
echo '<td width="100">' . $row2['naam'] . '</td>';
echo '<td width="10">' . $row2['nummer'] . '</td>';
echo '<td width="10">' . $row2['inlog'] . '</td>';
echo '<td width="150">' . $row2['afdeling'] . '</td>';
echo '<td width="10">' . $row2['groep'] . '</td>';
echo'<td width="5"></td>';
}
else
{
echo '<td width="100"> </td>';
echo '<td width="10"> </td>';
echo '<td width="10"> </td>';
echo '<td width="150"> </td>';
echo '<td width="10"> </td>';
echo'<td width="5"></td>';
}
}
echo '</tr>';
}
echo '</table>';
?>
Voeg een klasse toe aan je css bestand:
.borderrij{border-bottom: 1px dotted #000000}
en dan zet je die klasse op je <tr> tag
<tr class='borderrij'>
Volgens mij zou dat moeten werken.
.borderrij{border-bottom: 1px dotted #000000}
en dan zet je die klasse op je <tr> tag
<tr class='borderrij'>
Volgens mij zou dat moeten werken.
'Mr.Moe:
Voeg een klasse toe aan je css bestand:
.borderrij{border-bottom: 1px dotted #000000}
en dan zet je die klasse op je <tr> tag
<tr class='borderrij'>
Volgens mij zou dat moeten werken.
.borderrij{border-bottom: 1px dotted #000000}
en dan zet je die klasse op je <tr> tag
<tr class='borderrij'>
Volgens mij zou dat moeten werken.
Dit werkt niet. Er veranderd niks.
Je moet het iig in je CSS aangeven en dat kan op deze manier:
table th {
border-left: 0px solid #888;
border-bottom: 0px solid #888;
}
table td {
border-left: 0px solid #888;
border-bottom: 0px solid #888;
}
Dan zou je bijv. de table td, bordor-bottom op 1px kunnen zetten.
In je PHP pagina zet je dan gewoon: (in je head)
<link href="jou bestand" rel="stylesheet" type="text/css" media="screen" />
Gr, Cas
table th {
border-left: 0px solid #888;
border-bottom: 0px solid #888;
}
table td {
border-left: 0px solid #888;
border-bottom: 0px solid #888;
}
Dan zou je bijv. de table td, bordor-bottom op 1px kunnen zetten.
In je PHP pagina zet je dan gewoon: (in je head)
<link href="jou bestand" rel="stylesheet" type="text/css" media="screen" />
Gr, Cas
Gewijzigd op 01/01/1970 01:00:00 door Cas
Als het goed is zou die style toevoegen genoeg moeten zijn. Het maakt niet uit of het dan in een class zit of niet.
Wat je nog even kunt proberen is om die border="0" uit de table te gooien. Als je gewoon gebruik maakt van css om je tabel op te maken werkt het gewoon. Zie ook bijvoorbeeld:
http://veerle.duoh.com/blog/comments/a_css_styled_table/
http://veerle.duoh.com/blog/comments/a_css_styled_table_version_2/
http://veerle.duoh.com/index.php/blog/comments/a_css_styled_calendar/
Wat je nog even kunt proberen is om die border="0" uit de table te gooien. Als je gewoon gebruik maakt van css om je tabel op te maken werkt het gewoon. Zie ook bijvoorbeeld:
http://veerle.duoh.com/blog/comments/a_css_styled_table/
http://veerle.duoh.com/blog/comments/a_css_styled_table_version_2/
http://veerle.duoh.com/index.php/blog/comments/a_css_styled_calendar/
Ik heb het voor elkaar. Ik heb de style geplaatst in de <TD>'s
Voor de mensen die het resultaat willen zien:
Voor de mensen die het resultaat willen zien:
Code (php)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
ini_set('display_errors', 1); // 0 = uit, 1 = aan
error_reporting(E_ALL);
//includes
include('config.php');
include('dbcon.php');
echo '<b>Interne nummers op naam</b><br>';
// onderstaand de query
$query = mysql_query("SELECT naam, nummer, inlog, afdeling, groep FROM intern ORDER BY naam ASC");
// array vullen met resultaten
$array = array();
while($array[] = mysql_fetch_array( $query ));
// aantal kolommen die je wilt hebben
$kolommen = 2;
// dit is mysql_num_rows()
$max = mysql_num_rows($query);;
// aantal uitgerekende rijen
//$stap = ceil($max / $kolommen);
// vast aantal rijen
$stap = 78;
echo '<table ALIGN="left" STYLE="font-size: 5.5pt; border: 1px hidden;">
<tr>
<td width="100" STYLE="border-bottom: 2px solid black;"><b>Naam</b></td>
<td width="10" STYLE="border-bottom: 2px solid black;"><b>Telnr.</b></td>
<td width="10" STYLE="border-bottom: 2px solid black;"><b>Inlog</b></td>
<td width="150" STYLE="border-bottom: 2px solid black;"><b>Afdeling</b></td>
<td width="10" STYLE="border-bottom: 2px solid black;"><b>Groep</b></td>
<td width="5"></td>
<td width="100" STYLE="border-bottom: 2px solid black;"><b>Naam</b></td>
<td width="10" STYLE="border-bottom: 2px solid black;"><b>Telnr.</b></td>
<td width="10" STYLE="border-bottom: 2px solid black;"><b>Inlog</b></td>
<td width="150" STYLE="border-bottom: 2px solid black;"><b>Afdeling</b></td>
<td width="10" STYLE="border-bottom: 2px solid black;"><b>Groep</b></td>
</tr>';
for($i=0; $i<$stap; $i++)
{
echo '<tr>';
for($j=0; $j<$kolommen; $j++)
{
if(($i + ($j * $stap)) < $max)
{
// hier moet je fetchen en de data neerzetten
$row2 = $array[$i + ($j * $stap)];
echo '<td width="100" STYLE="border-bottom: 1px solid black;">' . $row2['naam'] . '</td>';
echo '<td width="10" STYLE="border-bottom: 1px solid black;">' . $row2['nummer'] . '</td>';
echo '<td width="10" STYLE="border-bottom: 1px solid black;">' . $row2['inlog'] . '</td>';
echo '<td width="150" STYLE="border-bottom: 1px solid black;">' . $row2['afdeling'] . '</td>';
echo '<td width="10" STYLE="border-bottom: 1px solid black;">' . $row2['groep'] . '</td>';
echo'<td width="5" STYLE="border-bottom: 1px solid black;"></td>';
}
else
{
echo '<td width="100"> </td>';
echo '<td width="10"> </td>';
echo '<td width="10"> </td>';
echo '<td width="150"> </td>';
echo '<td width="10"> </td>';
echo'<td width="5"></td>';
}
}
echo '</tr>';
}
echo '</table>';
?>
ini_set('display_errors', 1); // 0 = uit, 1 = aan
error_reporting(E_ALL);
//includes
include('config.php');
include('dbcon.php');
echo '<b>Interne nummers op naam</b><br>';
// onderstaand de query
$query = mysql_query("SELECT naam, nummer, inlog, afdeling, groep FROM intern ORDER BY naam ASC");
// array vullen met resultaten
$array = array();
while($array[] = mysql_fetch_array( $query ));
// aantal kolommen die je wilt hebben
$kolommen = 2;
// dit is mysql_num_rows()
$max = mysql_num_rows($query);;
// aantal uitgerekende rijen
//$stap = ceil($max / $kolommen);
// vast aantal rijen
$stap = 78;
echo '<table ALIGN="left" STYLE="font-size: 5.5pt; border: 1px hidden;">
<tr>
<td width="100" STYLE="border-bottom: 2px solid black;"><b>Naam</b></td>
<td width="10" STYLE="border-bottom: 2px solid black;"><b>Telnr.</b></td>
<td width="10" STYLE="border-bottom: 2px solid black;"><b>Inlog</b></td>
<td width="150" STYLE="border-bottom: 2px solid black;"><b>Afdeling</b></td>
<td width="10" STYLE="border-bottom: 2px solid black;"><b>Groep</b></td>
<td width="5"></td>
<td width="100" STYLE="border-bottom: 2px solid black;"><b>Naam</b></td>
<td width="10" STYLE="border-bottom: 2px solid black;"><b>Telnr.</b></td>
<td width="10" STYLE="border-bottom: 2px solid black;"><b>Inlog</b></td>
<td width="150" STYLE="border-bottom: 2px solid black;"><b>Afdeling</b></td>
<td width="10" STYLE="border-bottom: 2px solid black;"><b>Groep</b></td>
</tr>';
for($i=0; $i<$stap; $i++)
{
echo '<tr>';
for($j=0; $j<$kolommen; $j++)
{
if(($i + ($j * $stap)) < $max)
{
// hier moet je fetchen en de data neerzetten
$row2 = $array[$i + ($j * $stap)];
echo '<td width="100" STYLE="border-bottom: 1px solid black;">' . $row2['naam'] . '</td>';
echo '<td width="10" STYLE="border-bottom: 1px solid black;">' . $row2['nummer'] . '</td>';
echo '<td width="10" STYLE="border-bottom: 1px solid black;">' . $row2['inlog'] . '</td>';
echo '<td width="150" STYLE="border-bottom: 1px solid black;">' . $row2['afdeling'] . '</td>';
echo '<td width="10" STYLE="border-bottom: 1px solid black;">' . $row2['groep'] . '</td>';
echo'<td width="5" STYLE="border-bottom: 1px solid black;"></td>';
}
else
{
echo '<td width="100"> </td>';
echo '<td width="10"> </td>';
echo '<td width="10"> </td>';
echo '<td width="150"> </td>';
echo '<td width="10"> </td>';
echo'<td width="5"></td>';
}
}
echo '</tr>';
}
echo '</table>';
?>
'rick:
Ik heb het voor elkaar. Ik heb de style geplaatst in de <TD>'s
Daar moest ie ook sowieso staan. Het gaat toch over die td.............
Ja klopt, maar ik dacht dat ie in de <TR> hem ook zal pakken, maar dat was niet het geval. Beetje dom misschien, maar ben nog maar een newbie dusjaa...
'rick:
Ja klopt, maar ik dacht dat ie in de <TR> hem ook zal pakken, maar dat was niet het geval. Beetje dom misschien, maar ben nog maar een newbie dusjaa...
Naja, kijk ook maar naar die links van Veerle, dan zie je wat voor stoer spul je d'r mee kunt doen.




