Topic: Tables within CSS (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=11096" title="Pages that link to Topic: Tables within CSS (Page 1 of 1)" rel="nofollow" >Topic: Tables within CSS <span class="small">(Page 1 of 1)</span>\

 
genkidave
Nervous Wreck (II) Inmate

From: Japan
Insane since: Nov 2003

posted posted 11-09-2003 06:25

Hey guys, I was wondering. I have a nice Christmas CSS and have my table links with the colous and links nicely set up, but I want to implement the HTML table and links within the CSS file, that way I don't have to keep copy/paste the table inside a brand new HTML document when I create a new page, instead it'll automatically be loaded within the css file. Can it be done? Here's the table as it is in the CSS file and then the HTML document:

HTML:

<table>
<tr class="links">
<td></td><td></td><td></td><td></td>
<td class="links"><A href="http://japandrews.tripod.com/index.htm">Home</A></td>
<td></td><td></td><td></td><td></td><td></td><td></td>
<td class="links"><A href="http://japandrews.tripod.com/photos.html">Photos</A></td>
<td></td><td></td><td></td><td></td><td></td><td></td>
<td class="links"><A href="http://japandrews.tripod.com/comments.html">Comments</A></td>
<td></td><td></td><td></td><td></td>
</tr>
</table>

CSS File:

TABLE {background: #004000; border-width: medium; border-style: double; border-color: #FF0000; align: center;}
TR.links {font-size:18pt;}
TD.links {font-size:18pt;}

A:link {text-decoration: none; color: #FFFFFF;}
A:visited {text-decoration: none; color: #FFFFFF;}
A:hover {text-decoration: none; color:#FF0000;}


Can I put the HTML code into the CSS file and have the table auto load?

Thanks

Genki Dave

Suho1004
Maniac (V) Inmate

From: Seoul, Korea
Insane since: Apr 2002

posted posted 11-09-2003 10:41

Nope, you can't. That's not the way it works--CSS deals with presentation, while HTML deals with structure.

Now, if I understand you correctly, what you want to do is have a template for your site so you can keep the "shell" the same and just change the content. This is what I do on my site (click on "www.liminality.org" down there in my sig to check it out). You'll notice that the basic shell (menus, etc.) of the page are exactly the same for every page. This is what you are looking to do, right?

If so, it can't be done client-side. My template is done with PHP--I insert the appropriate content into the PHP file, depending on which page is being called. I hacked my template together myself, but I know there are some good tuts out there. If you think you might want to go this way, I can give your further info (or maybe we can start a new thread in the server-side forum). It would require a basic knowledge of PHP, though, and it can get complex depending on what you want to do.

I suppose I also should mention at this point that you might want to try CSS not just for styling links, but for layout as well. Tables were never meant to be used to layout pages--you can accomplish the same thing much more efficiently and reliably using CSS. Again, I'll wait for feedback from you before writing a novel on the subject.


___________________________
Suho: www.liminality.org

genkidave
Nervous Wreck (II) Inmate

From: Japan
Insane since: Nov 2003

posted posted 11-09-2003 13:27

Hi Lunatic, I know absolutley NOTHING about PHP other than ppl keep recomending it, and it's run server side.

If you please, start writing the novel

Genki Dave

Suho1004
Maniac (V) Inmate

From: Seoul, Korea
Insane since: Apr 2002

posted posted 11-09-2003 15:08

Oy, nothing about PHP? Well, I think I'll point you to some resources you might find handy, especially considering what you want to do: WarMage's Template Web Design with PHP, Part I and Template Web Design with PHP, Part II tutorials. That should give you a basic idea of what to do.

And if you're going to start messing around with PHP, I would recommend downloading and installing PHPdev. This will allow you to set up your system to run as an Apache server, thus giving you the ability to test your PHP locally. Since PHP is server-side, if you don't have this installed you'll have to upload your files to your server every time you want to test them, which can get old real quick. In addition, if you do manage to screw something up you'll only be bringing down your system, rather than a server with a whole bunch of sites on it.

Let's see... what else? Oh, of course: you'll definitely want to bookmark the PHP site. The documentation for PHP is very good, and the user comments really put it over the top in terms of usability and downright helpfulness. And if you're going to be doing a lot of coding in PHP, you might find Winsyntax to be a very helpful tool. It's your standard color-coded (color coding works for PHP, CSS, HTML, etc.) text editor, but it has a built in PHP help feature that gives you direct access to the documentation found on php.net. This is the only text editor I use anymore.

That should be enough to get you started, I think. There are PHP tutorials scattered here and there around the Web, and you can always drop a question in the server-side forum if you get stuck with something.

Oh yeah, and it's me, Suho--"lunatic" is just my "title"


___________________________
Suho: www.liminality.org

Gilbert Nolander
Maniac (V) Inmate

From: Washington DC
Insane since: May 2002

posted posted 11-26-2003 20:52

Or maybe this will help -----> PCP



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu