when ever i am putting all the style in the style tag it is working fine but if i put those codes in an external stylesheet it is not showing any style in frontend.
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php $title; ?></title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<table border="1" cellpadding="2" cellspacing="2">
<tr>
<th>post ID</th>
<th>post title</th>
<th>post Description</th>
<th>Author</th>
<th>Date</th>
</tr>
<?php
foreach($posts as $post)
{
echo "
<tr>
<td>".$post->Post_id."</td>
<td>".$post->post_title."</td>
<td>".$post->Post_description."</td>
<td>".$post->author."</td>
<td>".$post->date."</td>
</tr>
" ;
}
?>
</table>
<body>
</body>
</html>
and my external stylesheet is
/* CSS Document */
table{
width:1000px;
text-align:center;
margin:auto;
}
th{
background:#0CC;
animation-direction:normal;
height:50px;
}
td{
height:50px;
background:#396;
color:#FFF;
}
i donot understand what is wrong.
Your HTML <table> should be placed between the <body></body>.
Ummm, why is the table tag in the head part? There you should place only meta data, script data and all like, as far as I know / meta tags, script tags, title tag, link to bootstrap for example /. You should place your table tag in the body part and everything should be fine. Remember, the part in the head is NOT visible on you web page, only the things you put in the body. Hope that fixes your problem. :)
Try this:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php $title; ?></title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="1" cellpadding="2" cellspacing="2">
<tr>
<th>post ID</th>
<th>post title</th>
<th>post Description</th>
<th>Author</th>
<th>Date</th>
</tr>
<?php
foreach($posts as $post)
{
echo "
<tr>
<td>".$post->Post_id."</td>
<td>".$post->post_title."</td>
<td>".$post->Post_description."</td>
<td>".$post->author."</td>
<td>".$post->date."</td>
</tr>
" ;
}
?>
</table>
</body>
</html>
Related
I have a table based on a SQL query that I'm running through PHP that I would like to apply Datatables to for presentation and sorting purposes. However, when I run the page in the browser, I receive an error that indicates that I have an invalid JSON response.
Here is my code:
PHP script (with HTML):
<?php
session_start();
include 'connect.php';
$sql = "SELECT *
FROM SCHEMA.DETAIL_TABLE";
$result = mysql_query($sql);
$row_count=mysql_num_rows($result);
?>
<!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></title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/colreorder/1.3.3/css/colReorder.dataTables.min.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="javascript/detail_sorter.js" type="text/javascript"></script>
<script src="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/colreorder/1.3.3/js/dataTables.colReorder.min.js"></script>
</head>
<body>
<table id="disposalDetailTable" class="display">
<thead>
<tr>
<th>Ticket Number</th>
<th>Bay Number</th>
<th>Date Time</th>
<th>Customer</th>
<th>Driver</th>
<th>Total</th>
<th>Unload Time</th>
</tr>
</thead>
<tbody>
<?php
//This is the main detail data table. We loop through the SELECT statement.
while ($row = mysql_fetch_row($result)) {
echo "<tr>
<td>".($row[15])."</td>
<td>".($row[1])."</td>
<td>".($row[2])."</td>
<td>".($row[5])."</td>
<td>".($row[8])."</td>
<td>".(round($row[12], 1))."</td>
<td>".(round($row[13], 1))."</td>
</tr>";
}
?>
</tbody>
</table>
</body>
Here is my jQuery (filename = detail_sorter.js):
$(document).ready(function(){
$('#disposalDetailTable').DataTable();
});
I feel like I'm trying to keep it too simple. When use a static table the Datatables functionality works perfect. However, when I add the PHP dynamically I get the error that I mentioned.
Any help is appreciated.
I have the following code for generating HTML content to PDF using DomPDF.and my problem focuses on this line
$pdf_content='<!DOCTYPE html PUBLIC "-//W3C//DTD...
The entire code
<?php
error_reporting(0);
require_once ('dompdf_config.inc.php');
$pdf_content='<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<style type="text/css">
#pdf_header, #pdf_container{ border: 1px solid #CCCCCC; padding:10px; }
#pdf_header{ margin:10px auto 0px; border-bottom:none; }
table{ width:580px; }
#pdf_container{margin:0px auto; }
.rpt_title{ background:#99CCFF; }
</style>
<body>
<div id="pdf_header" >
<table border="0" cellspacing="1" cellpadding="2">
<tr id="hdRow">
<td width="20%"><img src="space_age_header.jpg" style="width:250px" ></td>
<td width="30%" align="center">Sample File</td>
<td width="30%" align="left">Marimuthu<br>User Code : 179865420</td>
</tr>
</table>
</div>
<div id="pdf_container" >
<table border="0" cellspacing="1" cellpadding="2">
<tr align="center" bgcolor="pink" style="color:#FFF"><td colspan="3"><b>Your Statement Summery</b></td> </tr>
<tr bgcolor="#006" style="color:#FFF"><td colspan="3" align="left">Your Heading.</td></tr>
</table>
<table> <tr> <td> Name </td><td> Department</td><td>Total </td><td>Grade </td> </tr>
<tr> <td> Marimuthu </td><td> Admin</td><td>250 </td><td>A </td> </tr>
</div></body></html>'
;
$name = date("Ymd").rand().'.pdf';
$reportPDF=createPDF(12, $pdf_content, 'activity_Report', $name );
function createPDF($pdf_userid, $pdf_content, $pdf_For, $filename){
$path='UsersActivityReports/';
/*$rndNumber=rand();
$filename=$pdf_userid.date("Ymd").$rndNumber.'.pdf';*/
$dompdf=new DOMPDF();
$dompdf->load_html($pdf_content);
$dompdf->render();
$output = $dompdf->output();
file_put_contents($path.$filename, $output);
return $filename;
}
echo '<a href="UsersActivityReports/'.$name.'" > Download </a>';
?>
I have extracted the $pdf_content='<!DOCTYPE html PUBLIC "-//W3C//DTD... part to another page page.php and modified it to allow generating files from database using a do while loop.
<?php
include("../../Connections/dbConfig.php");
$query_record = mysqli_query($link,"SELECT * FROM `subjects`") or
die (mysqli_error($link));
$row_record = mysqli_fetch_assoc($query_record);
$totalRows_record = mysqli_num_rows($query_record);
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<style type="text/css">
#pdf_header, #pdf_container{ border: 1px solid #CCCCCC; padding:10px; }
#pdf_header{ margin:10px auto 0px; border-bottom:none; }
table{ width:580px; }
#pdf_container{margin:0px auto; }
.rpt_title{ background:#99CCFF; }
</style>
<body>
<div id="pdf_header" >
<table border="0" cellspacing="1" cellpadding="2">
<tr id="hdRow">
<td width="20%"><img src="space_age_header.jpg" style="width:250px" ></td>
<td width="30%" align="center">Sample File</td>
<td width="30%" align="left">Marimuthu<br>User Code : 179865420</td>
</tr>
</table>
</div>
<div id="pdf_container" >
<table border="0" cellspacing="1" cellpadding="2">
<tr align="center" bgcolor="pink" style="color:#FFF"><td colspan="3"><b>Your Statement Summery</b></td> </tr>
<tr bgcolor="#006" style="color:#FFF"><td colspan="3" align="left">Your Heading.</td></tr>
</table>
<table>
<tr> <td> Subject </td><td> Code </td><td>Total </td><td>Grade </td> </tr>
<?php do { ?>
<tr> <td> <?php echo $row_record['subject']; ?> </td><td> <?php echo $row_record['code']; ?> </td><td>250 </td><td>A </td> </tr>
<?php } while ($row_record = mysqli_fetch_assoc($query_record)); ?>
</table>
</div></body></html>
Now this is where i am stuck. How do i implement this. How do i return the dynamically generated code back to the
$pdf_content='
and make it work.
$pdf_content= include('page.pp'); //something like this doesn't seem to work
I welcome any alternative idea on the same
The main thing to note about your code changes is that the HTML is now outside of a code block. This means that PHP will send that code to the browser as it's processed. To get around this you would need to enable output buffering to capture the rendered text.
ob_start();
include('page.php');
$pdf_content = ob_get_clean();
ob_end_clean();
Note that some systems may limit the size of the output buffer (see the output_buffering setting). You can check that using ini_get('output_buffering');. If a limit is enabled make sure the size of your rendered HTML is less than the maximum size of the buffer.
From the following HTML i need to extract email address only to save it in database. I need to pull it in array, what i was planning is to use jquery/ajax to pull all email using dom and save it to another page using ajax ,but the problem is that
<td> have no unique identification with other <td> i.e i can do it if td has class or id name
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="100%" border="1">
<tr></tr>
<tr>
<td>NAME</td>
<td>ADDRESS</td>
<td>PHONE</td>
<td>EMAIL</td>
</tr>
<tr>
<td>wwqw</td>
<td>qww</td>
<td>ew</td>
<td>email#exmaple.com</td>
</tr>
<tr>
<td>e</td>
<td>wew</td>
<td>ew</td>
<td>emai1l#exmaple.com</td>
</tr>
<tr>
<td>e</td>
<td>ewe</td>
<td>we</td>
<td>email2#exmaple.com</td>
</tr>
<tr>
<td>we</td>
<td>we</td>
<td>we</td>
<td>emai3l#exmaple.com</td>
</tr>
<tr>
<td>ww</td>
<td>w</td>
<td>w</td>
<td>emai4l#exmaple.com</td>
</tr>
</table>
</body>
</html>
I need to grab email address and store in array like below
Array
(
[0] => email#exmaple.com
[1] => emai1l#exmaple.com
[2] => email2#exmaple.com
[3] => emai3l#exmaple.com
[4] => emai4l#exmaple.com
)
<td> can have variable class and id , so its very hard to use jquery etc to pull them. I am obstructed by it . Any help wil be appreciated
Using jQuery-->
$(document).ready(function() {
$('tr').find('td:last').each(function(){
var t = $(this).text();
if(typeof(t) === 'string' && t.indexOf('#') >-1) alert(t);
})
});
do not use jquery, regular expression will make your job easy.
$string='<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="100%" border="1">
<tr></tr>
<tr>
<td>NAME</td>
<td>ADDRESS</td>
<td>PHONE</td>
<td>EMAIL</td>
</tr>
<tr>
<td>wwqw</td>
<td>qww</td>
<td>ew</td>
<td>email#exmaple.com</td>
</tr>
<tr>
<td>e</td>
<td>wew</td>
<td>ew</td>
<td>emai1l#exmaple.com</td>
</tr>
<tr>
<td>e</td>
<td>ewe</td>
<td>we</td>
<td>email2#exmaple.com</td>
</tr>
<tr>
<td>we</td>
<td>we</td>
<td>we</td>
<td>emai3l#exmaple.com</td>
</tr>
<tr>
<td>ww</td>
<td>w</td>
<td>w</td>
<td>emai4l#exmaple.com</td>
</tr>
</table>
</body>
</html>';
echo "<pre>";
$pattern="/([\s]*)([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*([ ]+|)#([ ]+|)([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,}))([\s]*)/i";
preg_match_all($pattern, $string, $matches);
print_r($matches[0]);
<?php
include('simple_html_dom.php');
$html = '<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="100%" border="1">
<tr></tr>
<tr>
<td>NAME</td>
<td>ADDRESS</td>
<td>PHONE</td>
<td>EMAIL</td>
</tr>
<tr>
<td>wwqw</td>
<td>qww</td>
<td>ew</td>
<td>email#exmaple.com</td>
</tr>
<tr>
<td>e</td>
<td>wew</td>
<td>ew</td>
<td>emai1l#exmaple.com</td>
</tr>
<tr>
<td>e</td>
<td>ewe</td>
<td>we</td>
<td>email2#exmaple.com</td>
</tr>
<tr>
<td>we</td>
<td>we</td>
<td>we</td>
<td>emai3l#exmaple.com</td>
</tr>
<tr>
<td>ww</td>
<td>w</td>
<td>w</td>
<td>emai4l#exmaple.com</td>
</tr>
</table>
</body>
</html>';
$dom = new simple_html_dom();
$dom->load($html);
$table = $dom->find('table', 0);
if($table){
foreach($table->find('tr') as $row) {
$rowData = array();
foreach($row->find('td') as $cell) {
$rowData[] = $cell->innertext;
}
$theData[] = $rowData;
}
print_r($theData);
}
?>
Or you can do it with jquery
$(document).ready(function() {
$('tr').find('td:last').each(function(){
console.log($(this).text());
})
});
I've created a product catalogue with category - subcategory - individual product page. I pass a $category to the individual product page. This page lists various details about the item, including which category the item belongs to. Since the $category variable is already set, I thought Return to previous category would be enough to return it to the subcategory page but it doesn't, part of the category.php that handles this looks like this.
EDIT: Full code
product_list.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
?>
<?php
include "storescripts/connect_to_mysql.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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
</style>
<meta name="Description" content="Lightweight aluminum boat docks, lifts, and accessories" />
<meta name="Keywords" content="Aluminum boat dock ladder lift water wheels" />
<script src="scripts/swfobject_modified.js" type="text/javascript"></script>
</head>
<title>Products</title>
<link rel="stylesheet" href="style/style.css" type="text/css" media="screen"/>
</style>
<body>
<div align="center" id="mainWrapper">
<?php include_once("template_header.php");?>
<table width="100%" border="0" cellspacing="0" cellpadding="15">
<tr>
<td valign="top" align="center"><table width="100%" border="0" align="center">
<tr>
<td align="center" valign="middle"><p>Aluminum Docks</p>
<p><img src="inventory_images/aluminum docks/PN99002-6_24x4_PKG_LG.jpg" width="25%" height="64"/></p></td>
<td align="center"><p>Floating Docks</p>
<p><img src="inventory_images/floating dock/100225279.jpg" width="25%" height="64"/></p></td>
<td align="center"><p>Frame Docks</p>
<p><img src="inventory_images/frame dock/frameDock.jpg" width="25%" height="64" alt="Frame Dock" /></a></p></td>
<td align="center"><p>Pipe Docks</p>
<p><img src="inventory_images/pipe dock/PN99002_16X4_SECTION_LG.jpg" width="25%" height="64" alt="Pipe Dock" /></p></td>
</tr>
<tr>
<td align="center"><p>Boat Lifts</p>
<p><img src="inventory_images/boat lifts/GM1060_LG.jpg" width="25%" height="64" alt="Boat Lift" /></p></td>
<td align="center"><p>Boat Lift Accessories</p>
<p><img src="inventory_images/boat lift acceessories/canopy_lg (1).png" width="25%" height="64" alt="Boat Lift Accessory" /></p></td>
<td align="center"><p>Rollers & Caddies</p>
<p><img src="inventory_images/rollers and caddies/caddy270 (1).jpg"width="25%" height="64" alt="Caddy" /></p></td>
<td align="center"><p>Accessories</p>
<p><img src="inventory_images/accessorries/2step_LG.png" width="25%" height="64" alt="Accessory" /></p></td>
</tr>
</table>
</table>
<p> </p>
<?php include_once("template_footer.php");?>
</div>
</body>
</html>
**category.php**
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
?>
<?php
// Run a select query to get my letest 6 items
// Connect to the MySQL database
include "storescripts/connect_to_mysql.php";
$category=$_GET['category'];
$sql = mysql_query("SELECT * FROM products WHERE category='$category' LIMIT 50");
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
$dynamicList="";
while($row = mysql_fetch_array($sql)){
$id = $row["id"];
$product_name = $row["product_name"];
$price = $row["price"];
$date_added = strftime("%b %d, %Y", strtotime($row["date_added"]));
$dynamicList .= '<table width="100%" border="0" cellspacing="0" cellpadding="6">
<tr>
<td width="17%" valign="top"><img style="border:#666 1px solid;" src="inventory_images/' . $id . '.jpg" alt="' . $product_name . '" width="100" height="64" border="1" /></td>
<td width="83%" valign="top">' . $product_name . '<br />
$' . $price . '<br />
View Product Details</td>
</tr>
</table>';
}
} else {
$dynamicList = "We have no products listed in our store yet";
}
mysql_close();
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
</style>
<meta name="Description" content="Lightweight aluminum boat docks, lifts, and accessories" />
<meta name="Keywords" content="Aluminum boat dock ladder lift water wheels" />
<script src="scripts/swfobject_modified.js" type="text/javascript"></script>
</head>
<title><?php echo $category; ?></title>
<link rel="stylesheet" href="style/style.css" type="text/css" media="screen"/>
</style>
<body>
<div align="center" id="mainWrapper">
<?php include_once("template_header.php");?>
<div align="left">
<p><?php echo $dynamicList;?>
</p>
<div id="target_product"></div>
<p> </p>
</div>
<?php include_once("template_footer.php");?>
</div>
</body>
</html>
**product.php**
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
?>
<?php
include "storescripts/connect_to_mysql.php";
session_start();
//Check to see if the URL variable is set and exists in the database
if(isset($_GET['id'])){
$id=preg_replace('#[^0-9]#i','',$_GET['id']);
// Use this variable to see if the id exists, if yesthen get the product
// details, if no then exit the script and give message why.
$sql = mysql_query("SELECT * FROM products WHERE id ='$id' LIMIT 1");
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
// Get all product details
while($row = mysql_fetch_array($sql)){
$product_name = $row["product_name"];
$price = $row["price"];
$details = $row["details"];
$quantity = $row["quantity_in_stock"];
$category = $row["category"];
$date_added = strftime("%b %d, %Y", strtotime($row["date_added"]));
}
}else{
echo "That item does not exist.";
exit();
}
}else{
echo "Data to render this page is missing.";
exit();
}
mysql_close();
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
</style>
<meta name="Description" content="Lightweight aluminum boat docks, lifts, and accessories" />
<meta name="Keywords" content="Aluminum boat dock ladder lift water wheels" />
<script src="scripts/swfobject_modified.js" type="text/javascript"></script>
</head>
<title><?php echo $product_name; ?></title>
<link rel="stylesheet" href="style/style.css" type="text/css" media="screen"/>
</style>
<body>
<div align="center" id="mainWrapper">
<?php include_once("template_header.php");?>
<table width="100%" border="0" cellspacing="0" cellpadding="15">
<tr>
<td width="20%" valign="top" ><img src="inventory_images/<?php echo $id;?>.jpg" alt="<?php echo $product_name; ?>" />
<td width="80%" valign="top"> <h3><?php echo $product_name; ?></h3>
<p>$<?php echo $price; ?><br/>
<?php echo $category; ?>
<br/>
<?php echo $details; ?><br/>
<?php echo $quantity;?>
<p>Return to previous category</p>
</table>
<p> </p>
<?php include_once("template_footer.php");?>
</div>
</body>
</html>
If you want all data that was containing your previous page, use SESSION superglobal for this purpose.
A few days ago, I asked a question regarding folding div ([link text][fold-unfold div]). The answers I got allowed me to make good progress in my coding effort. However, my requirements have changed.
Being a newbie with all this web stuff, I though that wrapping the divs with a table and table headers would be easy. Boy, was I wrong.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Animate my Div</title>
<style type="text/css" media="screen">
a {text-decoration: none; color: black; }
#expand {background-color: #fff;}
.description {display: none; }
.entry {margin: 0; padding: 0px;}
</style>
<script src="jquery-1.3.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".entry a").click(function() {
$(this).parents('.entry').find('.description').slideToggle(1000);
});
});
</script>
</head>
<body>
<?php
$con = mysql_connect("korg", "joe", "bob");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("wfr11", $con);
$result = mysql_query("
select title,description from webcases");
?>
<table border="1">
<thead>
<tr>
<th>title</th>
</tr>
</thead>
<?php
while ($row = mysql_fetch_array($result)) {
?><div class="entry"><tr>
<td>
<?php echo htmlentities($row['title']); ?>
<div class="description"><?php echo htmlentities($row['description']); ?></div>
</td>
</tr></div>
<?php
}
mysql_close($con);
?>
</table>
</body>
</html>
Now, a click on a ticket title does not work. I remove all the code for the table, it works fine: click on a title and the description unfolds
I should be able to fold my div (expand & description) into my table, right? What am I missing?
Chris, have a look here: http://jsfiddle.net/neopreneur/kdFHP/
Your HTML needs to look like this:
<table border="1">
<thead>
<tr>
<th>title</th>
</tr>
</thead>
<tbody>
<tr>
<td class="entry">
Title Text (click here)
<div class="description">Description Text</div>
</td>
</tr>
</tbody>
</table>