![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
|
I'm not sure whether this should go in the Perl or HTML forum, but here goes:
In an attempt to make this CGI page in perl more W3C- and future-compliant, I've just finished converting it into XHTML 1.0 strict and CSS, fully validated by the W3C's validator. (That's actually a static copy of the page's output, not the CGI script, but it should be enough to give the general idea.) Anyway, I've heard that tables are going to be phased out eventually, and that it's a good idea to replace tables with CSS notation and <div> sections. I did this for the basic layout of the page, but here's the problem: The list on the left side of the screen is a table generated dynamically by the CGI script. It parses a text file for its data and creates the table. Here's the code for that part of the script. print <<EOS;
<div id='buddy-list'>
<table class="subtable">
<tr><td>BUDDY</td><td style='width:60px'>LINES</td></tr>
EOS
open(AIMCOUNT,'/DocumentRoot/aimcount.txt');
$i=1;
while($line = <AIMCOUNT>) {
($numlines,$screenname) = split('&',"$line");
chomp($screenname);
if($i / 2 == int($i / 2)) {
$cellformat = ' class=\'altrow\'';
} else {
$cellformat = '';
}
print("\<tr$cellformat\><td\>");
print("$screenname");
print("\<\/td\>\<td style='text-align: right'\>");
print("$numlines");
print("\<\/td\>\<\/tr\>\n");
$i++;
}
close(AIMCOUNT);
__________________
Remember: no matter what odds you're up against, or how many times you've tried already, it can't hurt to SPAWN MORE OVERLORDS. |
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
As far as i no they are not phasing out tables, its just people who want teh oh so great look at me and my design that are. They provide a bit more flaxibility design by CSS, bu tables will be there for data layout always as it is the most proctical way to do it.
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity." - Albert Einstein |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
You could use <div>'s to replace tables, though. I'm not sure how easy it would be (I'm not brushed up on the position attributes that you would use), but I'm sure that it can be done if you still want to go through with it.
![]()
__________________
"Time is an illusion. Lunchtime doubly so." -the late, great Douglas Adams |
|
|
|
|
|
#4 |
|
Programmer
|
Sarumont is absolutely right here.
If you are realy desperate to get rid of the tables, you can use the <div> tag, and use pixle shims to get around using them. But, at no time in the future, that I can see are tables going to be obsolete here. However, if you did want to get really fancy with it all, you could get into Javascript or vbscript to create your tables. but I honestly wouldn't even go that far. Your code here looks correct, and I am assuming that it works on your site. If it isn't broke, don't fix it, as they say. Hope this helps you Mike
__________________
Here's my latest project still in the works, and I need to get rid of this "frame" situation for real. www.prideofaustin.com |
|
|
|
|
|
#5 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Check this out - it shows you how to use the <div> tags together with the float attribute:
http://www.yourhtmlsource.com/styles...csslayout.html |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|