[Wylug-help] HTML/CSS table width

Gary Stainburn gary.stainburn at ringways.co.uk
Wed May 7 15:51:56 BST 2008


On Wednesday 07 May 2008 15:36, Nigel Metheringham wrote:
> On 7 May 2008, at 15:05, Gary Stainburn wrote:
> > Dave, This was the solution I'd arrived at myself, butI wanted to
> > avoid
> > including extra HTML, such as the COL tags every time I used the
> > table class.
>
> If you are looking at a 2 column table (rare probably), or a multi-
> column where all but the first column are the same width, there is a
> CSS selector to pick out the first occurrence of a child element - so
> use something like
>     table { width: 100%;}
>     tr:first-child { width: 40%; }
>
> I think there are some additional tricks of this type, but my CSS cribs
> are at home...
>
> 	Nigel.

Thanks for this Nigel.  This is the sort of solution I was looking for, but 
because of the layout of the table, i.e. fixed size header cell followed by a 
data cell, Chris' solution worked.

Dave, The reasons I didn't want to do it in HTML are:

1) the objective is presentation specific and therefore should be in CSS
2) by eliminating repeated HTML I've reduce the chances of error as well as 
the size of the HTML.

Once again, thanks all.
-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     



More information about the Wylug-help mailing list