View Full Version : A better way to do this ..

01-22-2004, 09:58 PM
Hey Guys,

I have a listing here, which looks good. Although, I think there's a better/cleaner way I can do the same thing with less code. Maybe it's just the <br> tags after each line that bother me. In any case, I wanted to get a second opinion.

As always, any suggestions are appreciated:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">



<style type="text/css">

body {
background: #fff url(bg.gif) no-repeat fixed top left;
font-family: verdana, helvetica, arial, sans-serif;
margin: 0;
color: #333;

.schedules {
margin: 0;
width: 508px;
text-align: left;
font-size: 11px;
line-height: 18px;
border:1px solid #ffcc00;

.schedules.leftside {
width: 60px;
text-align: left;
/*border: 1px solid #000;*/

.schedules.middle {
width: 290px;
text-align: center;
/*border: 1px solid #ccc;*/

.schedules.rightside {
width: 150px;
text-align: left;
/*border: 1px solid #fae453;*/


<div class="schedules">
<span class="leftside">
<span class="middle">
North Florida Motorsports Park<br>
Las Vegas Motor Speedway<br>
2004 Cycle Jam, Virginia International<br>
California Speedway<br>
Grattan Raceway<br>
Summit Point Raceway<br>
Talladega Gran Prix Raceway<br>
Nelson Ledges Road Course<br>
Barber Motorsports Park<br>
Grand National/Suzuki Cup Finals<br>
<span class="rightside">
Jennings, Florida<br>
Las Vegas, Nevada<br>
Alton, Virginia<br>
Fontana, California<br>
Grattan, Michigan<br>
Summit Point, W. Virginia<br>
Talladega, Alabana<br>
Garrettsville, Ohio<br>
Leeds, Alabama<br>
Braselton, Georgia<br>


01-22-2004, 10:02 PM
That's a perfect example of what you should be using a table for.

01-22-2004, 10:12 PM
Yes I know. :)

01-22-2004, 10:37 PM
*sigh* ... You are in violation of our posting quidelines! I made a sticky about this called "Read this first" or something, you can't miss it. There is also the link next to the subject field when posting a new post and of course that link up in the top right marked "Posting Guidelines: Read this before you post" with a nice yellow exclaimation mark warning sign thingy..

[edit:] Kraftomatic, you have over 140 posts!! I'd expect much better from a senior member. ;)

01-22-2004, 10:59 PM
I have read it. What did I do wrong?

I know this can be done with tables. I'm looking for input on how it can be done better compared to what I have (specifically removing br tags after each line).

Am I still in the wrong?

01-22-2004, 11:19 PM
You misunderstood what I said - I meant that this is something you SHOULD use a table for, semantically a table is the right thing to use, since this is to a very high degree tabular data. Possibly a list, but a table is even more correct. So, why use your hackup of a tabular presentation for something that really should have been a table from the start?