Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 06-25-2012, 10:21 AM
Midwifery Online's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-12-09
Location: UK
Posts: 632
iTrader: 10 / 100%
Tables and background images

I have a table here which looks really bland and horrible - http://www.midwiferyonline.co.uk/con...g-study-days_1

I would love to jaz it up with a background image but I'm not sure how.

I have seen a lovely background image design here - http://coding.smashingmagazine.com/2...table-designs/ Scroll down to 9. Table background.

I love how the image looks on the table and love how it changes when you go over a column.

My table is a mixture of html and php... So I'm not really sure how to go about it..? Is it diffucult to do?
 
Reply With Quote
  #2 (permalink)  
Old 06-25-2012, 11:37 AM
ScriptMan's Avatar
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 10,107
iTrader: 4 / 100%
Your page is produced using divs, not a table. If you view the page source using Firefox the 'table'/DIV starts at about line 665.

I would assume it uses one of the 4 CSS files that are shown in your <Head> but I do not know which or what affect changing the CSS file might have on other site pages. If you want to be sure and change only one page it might be better to break the rules and do inline styling for that page.

This is not my strongest area.
__________________
SEO does not mean Spam Everywhere Online
Scriptman's Playhouse || Ramblings from an old man
2013 resolution: Don't feed trolls
ScriptMan
 
Reply With Quote
  #3 (permalink)  
Old 06-25-2012, 11:44 AM
Midwifery Online's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-12-09
Location: UK
Posts: 632
iTrader: 10 / 100%
I'm pulling that table into the page using an iframe.

At the moment I don't think the table actually has any CSS assigned to it.

This is what is in the file -

Code:
<?php error_reporting(E_ALL & ~E_NOTICE); require_once('global.php'); ?> <html> <head> <style type="text/css"> td { border:1px solid #000;vertical-align:top;overflow:hidden;} table{ width:100%; } </style> <title>Untitled</title> </head> <body> <? date_default_timezone_set('Europe/Dublin'); $time_stamp = time(); $data = mysql_query("SELECT * FROM event WHERE visible=1 AND (calendarid=3 OR calendarid=4) AND dateline_from>=$time_stamp ORDER BY dateline_from ASC") or die(mysql_error()); Print "<table>"; $i=0; while($info = mysql_fetch_array( $data )) { $i++; if($i <= 12) { Print "<tr><td><b>ID:</b><br> ".$info['eventid'] ."</td> "; Print "<td><b>Title:</b><br> ".$info['title'] ."</td> "; Print "<td><b>Event Details:</b><br> ".$info['event'] ." </td>"; Print "<td><b>Places:</b><br> <center>".$info['remaining_places'] ."</center> </td>"; Print "<td><b>More Info:</b><br> <center>".$info['more_info'] ."</center> </td></tr>"; } } Print "</table>"; ?> </body> </html>
Pretty bland eh?

edit: I think this is the wee bit of css applied -

Code:
td { border:1px solid #000;vertical-align:top;overflow:hidden;} table{ width:100%; }
 
Reply With Quote
  #4 (permalink)  
Old 06-25-2012, 11:53 AM
stone's Avatar
Contributing Member
 
Join Date: 03-28-06
Location: Macon GA USA
Posts: 213
iTrader: 0 / 0%
I think I'd give the table a different background colour, and see how that went before using a picture.
I personally do not like pictures as backgrounds...

looks like there's a coding issue that should be dealt with b4 nething else:
Code:
'); loadVbCss(yuipath + '/treeview/assets/skins/sam/treeview.css'); //-->

Last edited by stone; 06-25-2012 at 11:57 AM.
 
Reply With Quote
  #5 (permalink)  
Old 06-25-2012, 11:54 AM
ScriptMan's Avatar
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 10,107
iTrader: 4 / 100%
Then you can do it inline (on the Page) or using CSS. That page you linked to in your first post shows how. Personally I would skip the image and just use color.

Doing it on page the syntax is something like:

PHP Code:
Print "<tr><td [COLOR="Red"]color='hex #'[/COLOR]><b>ID:</b><br> ".$info['eventid'] ."</td> "
I am not sure that is supported in that exact format. I will find a working sample on my hard drive.
__________________
SEO does not mean Spam Everywhere Online
Scriptman's Playhouse || Ramblings from an old man
2013 resolution: Don't feed trolls
ScriptMan
 
Reply With Quote
  #6 (permalink)  
Old 06-25-2012, 02:15 PM
Midwifery Online's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-12-09
Location: UK
Posts: 632
iTrader: 10 / 100%
Quote:
Originally Posted by stone View Post
I think I'd give the table a different background colour, and see how that went before using a picture.
I personally do not like pictures as backgrounds...

looks like there's a coding issue that should be dealt with b4 nething else:
Code:
'); loadVbCss(yuipath + '/treeview/assets/skins/sam/treeview.css'); //-->
Where did you get that from and what is wrong with it? I think that's part of VBulletin.. Nothing to do with me lol.

Thanks guys I'll try giving it a background colour and go from there. I just want it to look more smooth and rounded it just looks so jagged and square lol.
 
Reply With Quote
  #7 (permalink)  
Old 06-25-2012, 11:45 PM
Super Moderator
Latest Blog:
None

 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 1,766
iTrader: 0 / 0%
Here is the table code as standard xhtml;
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Title</title> <style type="text/css"> .tableClass { text-align: left; background-color: white; color: navy; margin: 0px; padding: 0px; border: 0px; width: 400px; background: white url(seashell.png) no-repeat right bottom; } .tableClass th { text-align: left; text-weight: bold; font-size: 16px; } .tableClass td { font-size: 12px; border-top: 1px solid white; } .tableClass td,.tableClass th { padding: 12px; } .tableRowClass { background: url(lightbluedot.png) repeat; } .tableRowClass:hover { background-image: none; } </style> </head> <body> <table cellspacing="0" cellpadding="0" class="tableClass"> <tr><th>Employee</th><th>Division</th><th>Suggestions</th></tr> <tr class="tableRowClass"><td>Stephen C. Cox</td><td>Marketing</td><td>Make discount offers</td></tr> <tr class="tableRowClass"><td>Josephin Tan</td><td>Advertising</td><td>Give bonuses</td></tr> <tr class="tableRowClass"><td>Joyce Ming</td><td>Marketing</td><td>New designs</td></tr> <tr class="tableRowClass"><td>James A. Pentel</td><td>Marketing</td><td>Better Packaging</td></tr> </table> </body> </html>
And here is the code integrated with the php-code you posted:
PHP Code:
<?php    
error_reporting
(E_ALL & ~E_NOTICE);
require_once(
'global.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
.tableClass
{
    text-align: left;
    background-color: white;
    color: navy;
    margin: 0px;
    padding: 0px;
    border: 0px;
    width: 100%;
    background: white url(/images/seashell.png) no-repeat right bottom;
}

.tableClass th
{
    text-align: left;
    text-weight: bold;
    font-size: 16px;
}
 
.tableClass td
{
    font-size: 12px;
    border-top: 1px solid white;
}

.tableClass td,.tableClass th
{
    padding: 12px;
}

.tableRowClass
{
    background: url(/images/lightbluedot.png) repeat;
}

.tableRowClass:hover
{
    background-image: none;
}
</style>
<title>Untitled</title>
</head>
<body>
<?
date_default_timezone_set
('Europe/Dublin');
$time_stamp time();
$data mysql_query("SELECT * FROM event WHERE visible=1 AND (calendarid=3 OR calendarid=4) AND dateline_from>=$time_stamp ORDER BY dateline_from ASC") or die(mysql_error());
echo 
'<table cellspacing="0" cellpadding="0" class="tableClass">';  
echo 
'<tr><th>ID</th><th>Title</th><th>Event Details</th><th>Places</th><th>More Info.</th></tr>';  
$i=0;  
while(
$info mysql_fetch_array$data ))    
{    
    
$i++;
    if(
$i <= 12)
    {
    echo 
'<tr class="tableRowClass"><td>'.$info['eventid'].'</td>';   
    echo 
'<td>'.$info['title'].'</td>';   
    echo 
'<td>'.$info['event'].'</td>'
    echo 
'<td>'.$info['remaining_places'].'</td>';
    echo 
'<td>'.$info['more_info'].'</td></tr>'
    }   

echo 
"</table>";    
?>
</body>
</html>

The table uses two images that i have attached to this post. You need to upload them to http://www.midwiferyonline.co.uk/images/ or change the image file path in the css-code to match where you uploaded the images.

lightbluedot.png
A blue dot 50% transparent, mostly for compatibility as i could have used a partly transparent color instead.

seashell.png
The background image of the table, i just chose a seashell image for the heck of it.
Attached Files
File Type: zip tableimages.zip (12.1 KB, 6 views)
__________________
Need a break? EnterCave more than 40000 online games in 15 categories.
Search or browse through EnterCave Online Games Directory

Last edited by J. H. Rasmussen; 06-25-2012 at 11:51 PM.
 
Reply With Quote
  #8 (permalink)  
Old 06-29-2012, 03:13 AM
Midwifery Online's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-12-09
Location: UK
Posts: 632
iTrader: 10 / 100%
Sorry for the late reply, J. H. Rasmussen your a legend

Got my table up and working with a lovely wee back ground image!

Thank you so much!
 
Reply With Quote
  #9 (permalink)  
Old 06-29-2012, 03:50 AM
Super Moderator
Latest Blog:
None

 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 1,766
iTrader: 0 / 0%
You're welcome :-)
__________________
Need a break? EnterCave more than 40000 online games in 15 categories.
Search or browse through EnterCave Online Games Directory
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Background images in IE SimonG Coding Forum 6 11-26-2009 10:37 PM
Background Images Please Help dean19693 Web Design Lobby 4 10-18-2009 11:18 PM
Rotating background images using CSS and PHP Powerlines2000 Coding Forum 1 04-26-2008 01:44 PM
Alt Tag and Background Images Estreetloans SEO Forum 23 06-13-2007 11:57 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 08:35 AM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.