NYCPHP Meetup

NYPHP.org

[nycphp-talk] Abstracting CSS: Reusable HTML UI Components

Mark Armendariz lists at enobrev.com
Sat May 3 23:32:05 EDT 2008


Michael B Allen wrote:
> On Sat, May 3, 2008 at 10:57 PM, Mark Armendariz <lists at enobrev.com> wrote:
>   
>> Michael B Allen wrote:
>>
>>
>>     
>>> Secondarily, would you expect a professional library of this type to use
>>> tableless forms? Personally I have never been able to create tableless
>>> forms and have things line up into columns. So for now I'm going to use
>>> tables but I would be very interested in hearing someone make a case
>>> for tableless forms.
>>>       
> <snip>
>   
>>                      .myapp label {
>>                float:left;
>>                width: 70px;
>>                clear: left;
>>     
> <snip>
>   
>>  As for making a case for css forms, I think the above example speaks for
>> itself.
>>     
>
> As in good or bad? Your label width is fixed at 70px. If I lengthen
> the text of one of those labels the form element is displayed right
> over the top of it.
>
> Mike
>   

Well, the caveat is that the labels won't auto-fit for the whole 
'column', but it's simple to fix by increasing the label width.  I think 
the benefit of cleaner code trumps the auto-resizing the labels.  
Otherwise, you could write a js function that checks the label text and 
resizes them accordingly.  In the end it's a matter of personal style / 
choice, but I'd much rather maintain a tableless layout by adjusting a 
single css file than try to dance around table tags - even if they are 
auto-generated - especially if they're auto-generated since that means 
you have less html to maintain within your php code that generates the html.

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20080503/8c98cd19/attachment.html>


More information about the talk mailing list