Re: Re: PHP programming strategy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2009-08-07 at 11:06 +1000, Clancy wrote:
> On Thu, 06 Aug 2009 08:28:32 +0100, ash@xxxxxxxxxxxxxxxxxxxx (Ashley Sheridan) wrote:
> 
> .......
> >> >> Nested tables are the devils playthings!
> >> 
> >> I must be the devil, then.  I enjoy playing with them.  And if they're done right they
> >> seem to work on every system I have tried them on.  Granted Dreamweaver design mode gets
> >> its knickers in a knot if you nest them more than about 4 deep.
> >> 
> ...........
> >> 
> >> That's the joy of HTML errors - often the output will appear normal until you make some
> >> minor, and apparently irrelevant, change, when it all goes haywire.
> >> 
> >> 
> >That's not the only point. If you're on a slow connection you'll notice
> >the issue. Some browsers only start displaying the page once all the
> >layout data has been loaded. I've seen some sites with nesting levels of
> >7 tables deep sometimes, and that's just a mess. I'm also unsure how
> >text/speech/Braille browsers deal with complex table sites too.
> 
> I once watched a blind man go through one of my sites. I was apprehensive because I had no
> made no attempt to achieve compatibility, and had not bothered with any alt = ''
> declarations. The images were all in their own tables, and they all had titles, and he
> said that because of this the site was relatively good.
> >
> >And tables shouldn't be used for layout, use CSS instead!...
> 
> I was talking to another web designer last night. He started life as a designer, and said
> that he liked CSS because it was written by designers.  On the other hand I started life
> as a programmer (well I really started life as an engineer), and I find CSS hard to
> understand, and harder to write.  I can readily produce what I want with tables, but I
> have no idea how I could achieve many of the results I get with CSS alone.
> 
> How, for example, could I otherwise achieved the following effect, which displays an image
> with a border slightly darker than the background, and with the title and subtitle inside
> the border?
> 
>    <table class="pfm">
>       <tr>
>         <td>
>           <img src="Images/Nxxxxx.jpg" width="210" height="300">
>           <p class="nrmltextn">Yanni Nxxxxx </p>
>           <p class="notetextn">Sally Riordan Scholarship, 2007- </p>
>           </td>
>       </tr>
>     </table>
> 
> (And the thing that really astounds me about CSS is that they never thought of putting in
> constants. Instead of being able to specify a set of colours, and then simply quote them
> in the CSS whenever they are needed, I have to specify them in PHP, and then encode them
> into the CSS every time I use them, which is a real pain in the XXXX. The total lack of
> diagnostics is another real pain.)
> 
> 
Well, your above example would just become:

<div class="pfm">
    <img src="Images/Nxxxxx.jpg" width="210" height="300">
    <p class="nrmltextn">Yanni Nxxxxx </p>
    <p class="notetextn">Sally Riordan Scholarship, 2007- </p>
</div>

Notice how the amount of code has dropped immediately! From there, you
can use CSS to target whatever element you need to within the .pfm
class.

The images on your site would not had had titles if you'd omitted alt
tags. Where would the browser find them from to display to a blind
person?

True, CSS does not have constants, but that is why you create them to
cascade, so that elements inherit features from their parents. A bit
like classes in programming, where everything is either inherited from
the parent object (tag) or overridden with a new style.

Also, if you're looking for diagnostics, give Firebug a try, as it
really excels at this sort of thing. You can change styles on the fly
from within the browser window, without needing to refresh the page!

Thanks,
Ash
http://www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux