HTML Authoring - Basic Quesitons

JoLLyRoGer

Diamond Member
Aug 24, 2000
4,153
4
81
What is the best way to create a web page containing a reader pane?

Option 1:
Create the main page with an IFRAME and target sub-pages to the frame with my nav buttons to load new content.

Option 2:
Create several pages using the same basic page template and encapsulate the content in a scrolling DIV.

Thanks,
JR..
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
iframe = the devil
frames in general = the devil Unless there is no other possible way ever.
 

JoLLyRoGer

Diamond Member
Aug 24, 2000
4,153
4
81
Thanks notfred, you've got a couple of good points there. What about PHP content? Will using option 2 effect the way active PHP content behaves?
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: JoLLyRoGer
Thanks notfred, you've got a couple of good points there. What about PHP content? Will using option 2 effect the way active PHP content behaves?

Using PHP or not wont make a bit of difference in this situation.
 

JoLLyRoGer

Diamond Member
Aug 24, 2000
4,153
4
81
Originally posted by: LoKe
Option 2. Avoid frames and tables at all cost.

I've noticed a lot of seasoned web developers recommend avoiding tables like the plague yet a lot of the best free php pages use them religiously throughout the source code what's the reason for this? Moreover, what's the big deal with tables anyway?

Thanks Again...
 
Jun 4, 2005
19,723
1
0
Tables are messy. They hardly ever operate the way you'd like them to, and if you forget to close one, you've got a disaster waiting for you. They take up an unnecessarily large amount of space and...well...they suck.

Using Div's with CSS make things a lot cleaner. You're not repeating code over and over for the same effect. Makes storing information in databases a lot simpler.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: JoLLyRoGer
Originally posted by: LoKe
Option 2. Avoid frames and tables at all cost.

I've noticed a lot of seasoned web developers recommend avoiding tables like the plague yet a lot of the best free php pages use them religiously throughout the source code what's the reason for this? Moreover, what's the big deal with tables anyway?

Thanks Again...
Tables are frequently used for laying a page out but html should contain content and not layout instructions (that's what css is for). Using tables is a quick way to position things in ways that aren't always easy with css but they make the assumption that the viewer will be using a mainstream browser (which they may not be). In general, tables should only be used when you actually mean to display a table.

Honestly, sometimes I think that they're not the worst thing in the world if you are generating significant portions of the html automatically (so you don't have to type and maintain so much frickin code) but then again, I don't have an incredible amount of skill with css like many of the other folks who are advising you here, and using tables is still abusing the semtantics.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: LoKe
and if you forget to close one, you've got a disaster waiting for you.
To be fair, forgetting to close a div can get equally messy but there are plenty of situations with either where a browser can figure out what you meant anyway. In the end, the only proper solution is to make sure that all your html is valid.
 
Jun 4, 2005
19,723
1
0
Originally posted by: kamper
Originally posted by: LoKe
and if you forget to close one, you've got a disaster waiting for you.
To be fair, forgetting to close a div can get equally messy but there are plenty of situations with either where a browser can figure out what you meant anyway. In the end, the only proper solution is to make sure that all your html is valid.

It's easier to find an unclosed div than it is to sift through multiple <table><td><tr></tr></td></table><table><td><tr></tr></td></table><table><td><tr></tr></td></table><table><td><tr></tr></td></table>

Etc. :)
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
tables are ok when compared to frames. but as everyone said, CSS is the cleanest way of doing stuff. Keep the number of div's in check though!