• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Your thoughts on best way to layout news articles.

#1
[eluser]bugboy[/eluser]
Hi all

I've made a system that allows me to add new to my website.

In the backend i have it so it loops through the news articles into divs. I have looked through a few cms's and have seen that they use tables for this. Now i know you can use tables for tabular data but was just wondering what all your thoughts were on this.

Part of me is saying stay with your layout and the other is saying tables could make it a lot neater for this area.

#2
[eluser]the_namdeeW[/eluser]
I prefer using definition lists for this. Easy to style/format and keeps the code looking clean, unlike using tables.

<dl>
<dt>Title 1</dt>
<dd>Body 1</dd>
<dt>Title 2</dt>
<dd>Body 2</dd>
</dl>

#3
[eluser]Burgestrand[/eluser]
Uh… by titles you mean headlines? There's already a tag for that, h1 up to h6. By body you mean article contents? What does an article contain? Paragraphs. Now if there only was a ta- wait, <p>!

Code:
<h2>Title 1</h2>
<p>*content*</p>
<p>*content*</p>
<p>*content*</p>
<h2>Title 2</h2>
<p>*content</p>
… and so on.

There's lots of tags. They all have their proper usage area. Semantic coding is the way of marking up your documents' content logically. It's the next thing to get used to after moving to CSS from tables.

#4
[eluser]bugboy[/eluser]
Its got to contain

id
title
date
publish
edit
delete

This is why i thought a table might be useful for the list of articles in a backend / admin area for news.

I like the idea of a definition list for the front end sidebar though


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.