|
Posted by J.O. Aho on 02/25/07 17:09
Ron wrote:
> On Sun, 25 Feb 2007 12:17:18 +0100, "J.O. Aho" <user@example.net>
>> echo "<a
>> href=\"".stripslashes($row["location_url2"])."\".>".stripslashes($row["location_url1"])."</a>\n";
>>
>> I do think adding the new line at the end of each line html that is
>> echoed is a really good thing to do, as you this way will easier see
>> things when you look at the html-source in the browser.
>>
>> I'm not sure if you need stripslashes(), as those character that may
>> need that aren't allowed in an url, then you could use
>>
>> echo <<<EOL
>> <td class="aptbody">
>> <a href="{$row['location_url2']}">{$row['location_url1']}</a>
>> </td>
>> EOL;
>>
>> There ain't any point in using the width attribute in the td-tag, as you
>> are already using CSS and you can set the width in the CSS.
> Your concatenation above might work but my output is a 5 column table
> so the td statements should be separate, IMO.
You can use it on whole pages, in a project I have been playing with, all
static stuff has been made in this way and all dynamic are just variables in
the static stuff, IMHO this makes things a lot easier to read, but of course
it's a question about taste.
> I tried to add the newline to the end but could never make it work.
> <shrug> Good idea and will work on it more.
echo '\n'; //this outputs a string of 2 characters, \ and n
echo "\n"; //this outputs a newline (1 character)
Even if those two lines looks like the same, they aren't, using single quotes
you always get exactly that out, while double quotes allows things to be "parsed".
> The use of a table in this case I think is appropriate as it is
> tabular and just a habit to put percents. Better than pixels. :) But
> for kicks would you define the css element like td.col1, td.col2,
> td.col3, abd so on??? I ws looking as CSS.org and was getting lost.
css is a bit difficult, at least in the beginning, and I'm quite new on this too.
if you use id="something" then the setting looks something like:
#something td {
margin: 0.2em;
}
if you use class="anything" then the setting looks something like:
td.anything {
margin: 0.3em;
}
You can combine these (id="something" class="anything"):
#something td.anything {
margin: 0.3em;
}
You can first begins with a general td that has all the settings that all (or
most) has in common, then for those that needs some changes you create their
own classes.
td {
margin: 0.2em;
width: 10%;
}
td.anything {
width: 15%;
}
The rule that is last in the css file, will have higher priority over a rule
thats been defined before.
Keeping all in mind, you may not need special rules for each column in your table.
--
//Aho
[Back to original message]
|