Meerdere kolommen, van twee sets en headers met achtergrond kleur en tekst wit?

Status
Niet open voor verdere reacties.

richard5000

Gebruiker
Lid geworden
24 mrt 2012
Berichten
161
Ik heb als leek een database kunnen maken en de gegevens kunnen laten zien op web, nu zou ik graag willen weten hoe ik de headers van een kolom een invulkleur kan geven en de teks weer een andere kleur, maar wel dat het goed zichtbaar blijft, zoals nu zie http://www.rvvweb.nl/RJ/new100

Tweede vraag is hoe ik op de webpagina vanuit een tabel zichtbaar een verdeling kan maken met verschillende ruimtes tussen de kolommen, omdat ik werk met een soort vergelijking moet je op de webpagina het zien zoals:

Naam -------- Woonplaats ---------- Naam---------Woonplaats

In de tabel geef ik aan de kolommen verschillende namen, bijvoorbeeld naam1, woonplaats1 en naam2, woonplaats2 en laat dan op de webpagina het zien zoals hierboven weergegeven, de strepen staan voor de ruimte die ik ertussen wil hebben.

Hoop dat iemand mij kan helpen (heb al op web en uitleg gekeken, maar kom er niet uit) om onderstaand script aan te passen:

PHP:
<?php
 $con = mysql_connect("localhost","Username","password");
 if (!$con)
   {
   die('Could not connect: ' . mysql_error());
   }
 
mysql_select_db("testdatabase", $con);
 
$result = mysql_query("SELECT * FROM testtabel");
 
echo "<table border='0'>
 <tr>
 <th>Naam</th>
 <th>Woonplaats</th>
 </tr>";
 
while($row = mysql_fetch_array($result))
   {
   echo "<tr>";
   echo "<td>" . $row['naam'] . "</td>";
   echo "<td>" . $row['woonplaats'] . "</td>";
   echo "</tr>";
   }
 echo "</table>";
 
mysql_close($con);
 ?>
 
Laatst bewerkt:
Antwoord op vraag 1:
Dit is heel simpel op te lossen met behulp van CSS
Verander de <th> naar <th style="color:#FFFFFF; background-color:#000000;">
Je kun nu de kleuren veevangen met de kleuren die jij graag wilt.

Ook kun je helemaal bovenin tussen de head-tags het volgende zetten:
Code:
 th{
color:#FFFFFF;
background-color:#000000
}
Hiermee hoef je niet elke th tag te veranderen, maar heb je direct alles in een keer.

En van vraag 2 snap ik niet precies wat de bedoeling is.
 
Hoi,

Bedankt voor je reactie!

Ik ben wellicht wel heel dom, maar wat zijn de head-tags? Kun je wellicht voor mij het script zelf aanpassen, kan ik het zien en gebuiken.

Vraag twee is eigenlijk hoe ik veel ruimte krijg tusssen de kolommen, ik heb met de streepjes (--------) aangegeven hoeveel ruimte ik wil hebben.

En als je de kleuren kunt gebruiken en de ruimte tussen de kolommen moet het er uiteindelijk uitzien zoals hier http://www.rvvweb.nl/RJ/new5, maar dit lukt mij niet, heb wel tips gehad, maar niemand wil mijn script aanpassen.

Zoek als het klaar is ook nog een zoekfunctie in dezelfde PHP, zoals je kunt zien in voorbeeld http://www.rvvweb.nl/XX en als je kijkt op page 1 zie je mijn kop van tabel weer.

Maar dit lukt al helemaal niet.

Groet,
Richard
 
Laatst bewerkt:
kijk eens aan :

html en php gescheiden houden!

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>TJou Pagina naam</title>
        <style type="text/css">
             th{
color:#FFFFFF;
background-color:#000000
}
            </style>
    </head>

    <body>
        <?php
        $con = mysql_connect("localhost", "Username", "password");
        if (!$con) {
            die('Could not connect: ' . mysql_error());
        }

        mysql_select_db("testdatabase", $con);

        $result = mysql_query("SELECT * FROM testtabel");
        ?>
        <table border='0'>
            <tr>
                <th>Naam</th>
                <th>Woonplaats</th>
            </tr>
            <?php
            while ($row = mysql_fetch_array($result)) {
                ?>
                <tr>
                    <td><?php echo $row['naam']; ?></td>
                    <td><?php echo $row['woonplaats']; ?></td>
                </tr>
<?php } ?>
        </table>
            <?php
            mysql_close($con);
            ?>
    </body>
</html>
 
Hoi Klaaspeter,

Bedankt voor je reactie, ik heb dankzij jouw script mijn "oude html" van mijn webprogramma kunnen combineren en krijg nu de header met kleur etc.

Wat ik nu graag zou willen is dat mijn tabelgegevens ook op dezelfde positie komen onder de headers.

Geprobeerd met <td> maar dan moet ik er wel heel veel neerzetten, ook wil ik lettertype en grote kunnen aanpassen.

Weet alleen niet hoe ik dit erin krijg, heb het nu gedaan onder <tabel border> en "While" maar ik wil graag de kolomen apart een positie kunnen geven, zodat ze mooi onder de headers komen (ihoud cellen nu even niet van belang) van alles al geprobeerd, maar lukt mij niet.

Heb het nu geprobeerd om de kolommen op dezelfde positiek te krijgen als de headers (zie onder de tabel positie):

Vraag 1) Dus wat moet je gebruiken om de positie van de kolommen in dit script op dezelfde positie te krijgen als de gekleurde headers en moet ik lettertype aanpassen in database of ook in PHP script.

Vraag2) Wellicht wil je nog een keer het (aangepaste) script aanpassen?

Zoals ik het nu heb zie: http://www.rvvweb.nl/RJ/new8000

Script is nu:

PHP:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>TJou Pagina naam</title>
        <style type="text/css">
/*----------Text Styles----------*/
.ws6 {font-size: 8px;}
.ws7 {font-size: 9.3px;}
.ws8 {font-size: 11px;}
.ws9 {font-size: 12px;}
.ws10 {font-size: 13px;}
.ws11 {font-size: 15px;}
.ws12 {font-size: 16px;}
.ws14 {font-size: 19px;}
.ws16 {font-size: 21px;}
.ws18 {font-size: 24px;}
.ws20 {font-size: 27px;}
.ws22 {font-size: 29px;}
.ws24 {font-size: 32px;}
.ws26 {font-size: 35px;}
.ws28 {font-size: 37px;}
.ws36 {font-size: 48px;}
.ws48 {font-size: 64px;}
.ws72 {font-size: 96px;}
.wpmd {font-size: 13px;font-family: 'Arial';font-style: normal;font-weight: normal;}
/*----------Para Styles----------*/
DIV,UL,OL /* Left */
{
 margin-top: 0px;
 margin-bottom: 0px;
}
            </style>
    </head>
 
 <body>

<div id="html1" style="position:absolute; overflow:hidden; left:10px; top:5px; width:960px; height:350px; z-index:0">
<div id="table1" style="position:absolute; overflow:hidden; left:53px; top:22px; width:594px; height:168px; z-index:0">
<div class="wpmd">
<div><TABLE bgcolor="#FFFFFF" border=0 bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<TR valign=top>
<TD width=132 bgcolor="#FF0000"><div class="wpmd">
<div align=center><font color="#FFFFFF" class="ws12"><B>Art.Nr.</B></font></div>
</div>
</TD>
<TD><TD>
<TD width=126 bgcolor="#FF0000"><div class="wpmd">
<div align=center><font color="#FFFFFF" class="ws12"><B>Type</B></font></div>
</div>
</TD>
<TD width=31><BR>
</TD>
<TD width=124 bgcolor="#0000FF"><div class="wpmd">
<div align=center><font color="#FFFFFF" class="ws12"><B>Art.Nr.</B></font></div>
</div>
</TD>
<TD><TD>
<TD width=137 bgcolor="#0000FF"><div class="wpmd">
<div align=center><font color="#FFFFFF" class="ws12"><B>Type</B></font></div>
</div>
</TD>
</TR></div>

</body> 
 
    <body>
		<?php
        $con = mysql_connect("localhost", "Username", "password");
        if (!$con) {
            die('Could not connect: ' . mysql_error());
        }
 
        mysql_select_db("testdatabase", $con);
 
        $result = mysql_query("SELECT * FROM testtabel");
		?>
        <table border ='0'>
        <table TD {'width:594px; height:168px;'}
		<TD width=700
		<TD size=13px
		<?php
        while ($row = mysql_fetch_array($result)) {
		?>
        <tr>
        <td><?php echo $row['naam']; ?></td>
		<td><td>
		<td><?php echo $row['woonplaats']; ?></td>
        <td>
		<td><?php echo $row['naam2']; ?></td>
		<td><td>
		<td><?php echo $row['woonplaats2']; ?></td>
		</tr>
		<?php } ?>
        </table>
            <?php
        mysql_close($con);
        ?>
    </body>
</html>

Alvast onwijs bedankt!!
 
Laatst bewerkt:
Oke, ben weer iets verder, maar ik zoek nog steeds een mogelijkheid om mijn tabel precies onder de headers te krijgen (roord en blauw) en zodanig dat de kolommen ook vast blijven staan, ook al stat er geen tekst in bijvoorbeeld dus de grote moet altijd gelijk zijn met de headers erboven ook al is er een zonder tekst.

IK heb het nu tot zover:http://www.rvvweb.nl/RJ/new4000 kan iemand eventueel script aanpassen voor mij zodat hij ook werkt, thanks.

PHP:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>TJou Pagina naam</title>
        <style type="text/css">
/*----------Text Styles----------*/
.ws6 {font-size: 8px;}
.ws7 {font-size: 9.3px;}
.ws8 {font-size: 11px;}
.ws9 {font-size: 12px;}
.ws10 {font-size: 13px;}
.ws11 {font-size: 15px;}
.ws12 {font-size: 16px;}
.ws14 {font-size: 19px;}
.ws16 {font-size: 21px;}
.ws18 {font-size: 24px;}
.ws20 {font-size: 27px;}
.ws22 {font-size: 29px;}
.ws24 {font-size: 32px;}
.ws26 {font-size: 35px;}
.ws28 {font-size: 37px;}
.ws36 {font-size: 48px;}
.ws48 {font-size: 64px;}
.ws72 {font-size: 96px;}
.wpmd {font-size: 13px;font-family: 'Arial';font-style: normal;font-weight: normal;}
/*----------Para Styles----------*/
DIV,UL,OL /* Left */
{
 margin-top: 0px;
 margin-bottom: 0px;
}
            </style>
    </head>
 
 <body>

<div id="html1" style="position:absolute; overflow:hidden; left:10px; top:5px; width:960px; height:350px; z-index:0">
<div id="table1" style="position:absolute; overflow:hidden; left:53px; top:22px; width:594px; height:168px; z-index:0">
<div class="wpmd">
<div><TABLE bgcolor="#FFFFFF" border=0 bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<TR valign=top>
<TD width=132 bgcolor="#FF0000"><div class="wpmd">
<div align=center><font color="#FFFFFF" class="ws12"><B>Art.Nr.</B></font></div>
</div>
</TD>
<TD><TD>
<TD width=126 bgcolor="#FF0000"><div class="wpmd">
<div align=center><font color="#FFFFFF" class="ws12"><B>Type</B></font></div>
</div>
</TD>
<TD width=31><BR>
</TD>
<TD width=124 bgcolor="#0000FF"><div class="wpmd">
<div align=center><font color="#FFFFFF" class="ws12"><B>Art.Nr.</B></font></div>
</div>
</TD>
<TD><TD>
<TD width=137 bgcolor="#0000FF"><div class="wpmd">
<div align=center><font color="#FFFFFF" class="ws12"><B>Type</B></font></div>
</div>
</TD><td>
</TR><T
<TR></div>

</body> 
 
    <body>
		<?php
        $con = mysql_connect("localhost", "Username", "password");
        if (!$con) {
            die('Could not connect: ' . mysql_error());
        }
 
        mysql_select_db("testdatabase", $con);
 
        $result = mysql_query("SELECT * FROM testtabel");
		?>
        <table border ='1'>
        
		
		<?php
        while ($row = mysql_fetch_array($result)) {
		?>
        <tr><tr>
        <td><?php echo $row['naam']; ?></td>
		<td><?php echo $row['woonplaats']; ?></td>
        <td width=31><BR>
		<td><?php echo $row['naam2']; ?></td>
		<td><?php echo $row['woonplaats2']; ?></td>
		</tr>
		<?php } ?>
        </table>
            <?php
        mysql_close($con);
        ?>
    </body>
</html>
 
Laatst bewerkt:
Het probleem ligt bij regel 79.
<table border ='1'>
Hier open je een nieuwe tabel! Hierdoor komen de kolommen los van elkaar.

Verder was je vergeten om de eerste tabel te sluiten met de </table> tag. Ook staan er nog wat losse <td> tags in je script (regel 47 & 63)

PHP:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>TJou Pagina naam</title>
        <style type="text/css">
/*----------Text Styles----------*/
.ws6 {font-size: 8px;}
.ws7 {font-size: 9.3px;}
.ws8 {font-size: 11px;}
.ws9 {font-size: 12px;}
.ws10 {font-size: 13px;}
.ws11 {font-size: 15px;}
.ws12 {font-size: 16px;}
.ws14 {font-size: 19px;}
.ws16 {font-size: 21px;}
.ws18 {font-size: 24px;}
.ws20 {font-size: 27px;}
.ws22 {font-size: 29px;}
.ws24 {font-size: 32px;}
.ws26 {font-size: 35px;}
.ws28 {font-size: 37px;}
.ws36 {font-size: 48px;}
.ws48 {font-size: 64px;}
.ws72 {font-size: 96px;}
.wpmd {font-size: 13px;font-family: 'Arial';font-style: normal;font-weight: normal;}
/*----------Para Styles----------*/
DIV,UL,OL /* Left */
{
 margin-top: 0px;
 margin-bottom: 0px;
}
            </style>
    </head>
 
 <body>

<div id="html1" style="position:absolute; overflow:hidden; left:10px; top:5px; width:960px; height:350px; z-index:0">
<div id="table1" style="position:absolute; overflow:hidden; left:53px; top:22px; width:594px; height:168px; z-index:0">
<div class="wpmd">
<div><TABLE bgcolor="#FFFFFF" border=0 bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<TR valign=top>
<TD width=132 bgcolor="#FF0000"><div class="wpmd">
<div align=center><font color="#FFFFFF" class="ws12"><B>Art.Nr.</B></font></div>
</div>
</TD>
<TD><TD>
<TD width=126 bgcolor="#FF0000"><div class="wpmd">
<div align=center><font color="#FFFFFF" class="ws12"><B>Type</B></font></div>
</div>
</TD>
<TD width=31><BR>
</TD>
<TD width=124 bgcolor="#0000FF"><div class="wpmd">
<div align=center><font color="#FFFFFF" class="ws12"><B>Art.Nr.</B></font></div>
</div>
</TD>
<TD><TD>
<TD width=137 bgcolor="#0000FF"><div class="wpmd">
<div align=center><font color="#FFFFFF" class="ws12"><B>Type</B></font></div>
</div>
</TD><td>
</TR><T
<TR></div>

</body> 
 
    <body>
		<?php
        $con = mysql_connect("localhost", "Username", "password");
        if (!$con) {
            die('Could not connect: ' . mysql_error());
        }
 
        mysql_select_db("testdatabase", $con);
 
        $result = mysql_query("SELECT * FROM testtabel");
		?>
        <table border ='1'>// dit moet je weg halen, dan kunnen de php tags ook weg, dan zitten die aan elkaar.
        
		
		<?php
        while ($row = mysql_fetch_array($result)) {
		?>
        <tr><tr>
        <td><?php echo $row['naam']; ?></td>
		<td><?php echo $row['woonplaats']; ?></td>
        <td width=31><BR>
		<td><?php echo $row['naam2']; ?></td>
		<td><?php echo $row['woonplaats2']; ?></td>
		</tr>
		<?php } ?>
        </table>
            <?php
        mysql_close($con);
        ?>
    </body>
</html>
 
Hoi Klimmer, bedankt voor je reactie.

Ik heb het aangepast en heb nu bijna de tabel zoals ik hem wil hebben, http://rvvweb.nl/RJ/totaal, alvast bedankt!

Heb nog een vraag, namelijk:

Zou graag een zoekopdracht boven mijn tabel willen hebben, had er een gevonden, maar weet niet hoe ik deze er goed werkend in krijg (het liefst boven de rode kolom startend met een ruimte ertussen (of verplaatsbaar via script).

Of heeft iemand een andere waarbij je gedetaileerd kan zoeken via bijvoorbeeld een puldownmenu of invulveld en daarna op zoeken drukken, ik ben benieuwd.

Wie weet dit wel...?

Voor de duidelijkheid heb ik een script hieronder ingevoegd en deze moet in het script komen wat bij Klimmer staat, voorbeeld zie link voor de tabel zoals hij nu is, dus de tabel in onderstaand script hoef ik niet, maar hij moet in script komen van Klimmer...?

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>JavaScript Search</title>
    <style type="text/css">
        body { font-family: Arial; font-size: 11px; }
        td { font-family: Arial; font-size: 11px; }
        th { font-family: Arial; font-size: 11px; background-color: #c8c8c8; }
        input { font-family: Arial; font-size: 11px; }
    </style>
    <script language="javascript" type="text/javascript">
        //define the table search as an object, which can implement both functions and properties
        window.tableSearch = {};
 
        //initialize the search, setup the current object
        tableSearch.init = function() {
            //define the properties I want on the tableSearch object
            this.Rows = document.getElementById('data').getElementsByTagName('TR');
            this.RowsLength = tableSearch.Rows.length;
            this.RowsText = [];
            
            //loop through the table and add the data to
            for (var i = 0; i < tableSearch.RowsLength; i++) {
                this.RowsText[i] = (tableSearch.Rows[i].innerText) ? tableSearch.Rows[i].innerText.toUpperCase() : tableSearch.Rows[i].textContent.toUpperCase();
            }
        }
 
        //onlys shows the relevant rows as determined by the search string
        tableSearch.runSearch = function() {
            //get the search term
            this.Term = document.getElementById('textBoxSearch').value.toUpperCase();
            
            //loop through the rows and hide rows that do not match the search query
            for (var i = 0, row; row = this.Rows[i], rowText = this.RowsText[i]; i++) {
                row.style.display = ((rowText.indexOf(this.Term) != -1) || this.Term === '') ? '' : 'none';
            }
        }
 
        //runs the search
        tableSearch.search = function(e) {
            //checks if the user pressed the enter key, and if they did then run the search
            var keycode;
            if (window.event) { keycode = window.event.keyCode; }
            else if (e) { keycode = e.which; }
            else { return false; }
            if (keycode == 13) {
                tableSearch.runSearch();
            }
            else { return false; }
        }
    </script>
</head>
 
 
<body onload="tableSearch.init();">
    <table border="0" cellpadding="0" cellspacing="0">
        <tbody>
            <tr>
                <td>
                    <input type="text" size="30" maxlength="1000" value="" id="textBoxSearch" onkeyup="tableSearch.search(event);" />
                    <input type="button" value="Search" onclick="tableSearch.runSearch();" />
                </td>
            </tr>
        </tbody>
    </table>
    <br />
    <table border="1" cellpadding="2" cellspacing="0">
        <tr>
            <th>ID</th>
            <th>First Name</th>
            <th>Surname</th>
            <th>Website</th>
        </tr>
        <tbody id="data">
<?php
// regel voor contact maken database
$connect = mysql_connect('localhost','Username','Password');
 
mysql_select_db("testdatabase");
 
//regel voor selecteren uit database en laten zien op de webpagina 
$query = mysql_query("select * FROM testtabel LIMIT 0, 30 ");
if(!$query)
{
  echo mysql_error();
}
else
{
  while($rows = mysql_fetch_assoc($query)):
        echo '<tr>
  <td>'. $rows['id'] .'</td>
  <td>'. $rows['naam'] .'</td>
  <td>'. $rows['woonplaats'] .'</td>
  <td>'. $rows['naam'] .'</td>
</tr>';
        endwhile;
}
?>
        </tbody>
    </table>
</body>
</html>

Zou het zeer op prijs stellen als iemand dit kan en script wil plaatsen, alvast bedankt!
 
Laatst bewerkt:
Ik ben even bezig geweest. Ik geloof dat hij zo wel redelijk klopt.

Er zitten wel nog wat foutjes in. Zo open je op regel 100 een div met als class wpmd. maar vervolgens open je dit nóg een keer in elke cel (regel 111, 117, ...). Ik ben geen HTML expert, maar ik geloof dat dit ook niet goed is.

Hieronder staat het script mét zoekfunctie. Ik denk dat ik die zelf ook een keer ga gebruiken.

En probeer 1 topic open te houden, want anders krijg je verschillende versies van je script.

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>TJou Pagina naam</title>
        <style type="text/css">
/*----------Text Styles----------*/
.ws6 {font-size: 8px;}
.ws7 {font-size: 9.3px;}
.ws8 {font-size: 11px;}
.ws9 {font-size: 12px;}
.ws10 {font-size: 13px;}
.ws11 {font-size: 15px;}
.ws12 {font-size: 16px;}
.ws14 {font-size: 19px;}
.ws16 {font-size: 21px;}
.ws18 {font-size: 24px;}
.ws20 {font-size: 27px;}
.ws22 {font-size: 29px;}
.ws24 {font-size: 32px;}
.ws26 {font-size: 35px;}
.ws28 {font-size: 37px;}
.ws36 {font-size: 48px;}
.ws48 {font-size: 64px;}
.ws72 {font-size: 96px;}
.wpmd {font-size: 13px;font-family: 'Arial';font-style: normal;font-weight: normal;}
/*----------Para Styles----------*/
DIV,UL,OL /* Left */
{
 margin-top: 0px;
 margin-bottom: 0px;
}
            </style>
			
			
    <script language="javascript" type="text/javascript">
        //define the table search as an object, which can implement both functions and properties
        window.tableSearch = {};
 
        //initialize the search, setup the current object
        tableSearch.init = function() {
            //define the properties I want on the tableSearch object
            this.Rows = document.getElementById('data').getElementsByTagName('TR');
            this.RowsLength = tableSearch.Rows.length;
            this.RowsText = [];
            
            //loop through the table and add the data to
            for (var i = 0; i < tableSearch.RowsLength; i++) {
                this.RowsText[i] = (tableSearch.Rows[i].innerText) ? tableSearch.Rows[i].innerText.toUpperCase() : tableSearch.Rows[i].textContent.toUpperCase();
            }
        }
 
        //onlys shows the relevant rows as determined by the search string
        tableSearch.runSearch = function() {
            //get the search term
            this.Term = document.getElementById('textBoxSearch').value.toUpperCase();
            
            //loop through the rows and hide rows that do not match the search query
            for (var i = 0, row; row = this.Rows[i], rowText = this.RowsText[i]; i++) {
                row.style.display = ((rowText.indexOf(this.Term) != -1) || this.Term === '') ? '' : 'none';
            }
        }
 
        //runs the search
        tableSearch.search = function(e) {
            //checks if the user pressed the enter key, and if they did then run the search
            var keycode;
            if (window.event) { keycode = window.event.keyCode; }
            else if (e) { keycode = e.which; }
            else { return false; }
            if (keycode == 13) {
                tableSearch.runSearch();
            }
            else { return false; }
        }
    </script>
			
    </head>
 
<body onload="tableSearch.init();">
    <table border="0" cellpadding="0" cellspacing="0">
        <tbody>
            <tr>
                <td>
                    <input type="text" size="30" maxlength="1000" value="" id="textBoxSearch" onkeyup="tableSearch.search(event);" />
                    <input type="button" value="Search" onclick="tableSearch.runSearch();" />
                </td>
            </tr>
        </tbody>
    </table>
	
	<br/>
	
	<!---
	deze divs worden sowieso niet gesloten. en de position gaat over de textbox heen.
<div id="html1" style="position:absolute; overflow:hidden; left:10px; top:5px; width:960px; height:350px; z-index:0">
<div id="table1" style="position:absolute; overflow:hidden; left:53px; top:22px; width:594px; height:168px; z-index:0">
--->

<div class="wpmd">

<table  border="0" >
		<!---
		bgcolor is standaard wit.
		bgcolor="#FFFFFF"
		bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF"
		--->

<tr valign=top>
				<td width=132 bgcolor="#FF0000">
						<div class="wpmd">
						<div align=center><font color="#FFFFFF" class="ws12"><B>Art.Nr.</B></font></div>
						</div>
				</td>

				<td width=126 bgcolor="#FF0000">
						<div class="wpmd">
							<div align=center><font color="#FFFFFF" class="ws12"><B>Type</B></font></div>
						</div>
				</td>
				
				<td width=31>
				</td>
				
				<td width=124 bgcolor="#0000FF">
						<div class="wpmd">
							<div align=center><font color="#FFFFFF" class="ws12"><B>Art.Nr.</B></font></div>
						</div>
				</td>
			
				<td width=137 bgcolor="#0000FF">
						<div class="wpmd">
							<div align=center><font color="#FFFFFF" class="ws12"><B>Type</B></font></div>
						</div>
				</td>
</tr>

<tbody id="data">
        <?php
        $con = mysql_connect('localhost','Username','password');
        if (!$con) {
            die('Could not connect: ' . mysql_error());
        }
 
        mysql_select_db("testdatabase",$con);
 
        $result = mysql_query("SELECT * FROM testtabel");

        while ($row = mysql_fetch_array($result)) {
		?>
		
        <tr>
        <td><?php echo $row['naam']; ?></td>
		<td><?php echo $row['woonplaats']; ?></td>
        <td width=31></td>
		<td><?php echo $row['naam2']; ?></td>
		<td><?php echo $row['woonplaats2']; ?></td>
		</tr>
		
		<?php 
		}
		
mysql_close($con);
        ?>
		</tbody>
		</table>
		</div>
    </body>
</html>
 
He Klimmer, helemaal top...!!! Onwijs bedankt en zal een topic houden.

Heb al eens geprobeerd om de andere topics te deleten, maar dit lukt niet.

Groet,
Richard
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan