Go Back   Forum Care Forums > Development Reference Area > Webmaster Topics

Reply
 
LinkBack Thread Tools Display Modes
CSS centred alignment
Old
  (#1)
Mark Goodge
Guest
 
Posts: n/a
Default CSS centred alignment - 06-02-2007, 08:53 PM

I'm trying to create a list that's centred on a single character in the
middle of the line - something like a fixture list, like this:

Arsenal v Chelsea
Liverpool v Manchester Utd
West Ham v Reading
Stoke City v Internazionale
AFC Wimbledon v Hull
Ajax v PSV Eindhoven

(You'll need a monospaced font to see that correctly in this posting,
but if you don't have that luxury then imagine it's aligned so that all
the "v"s are in a single vertical line).

This effect is easy to achieve with tables, like this...

<tr>
<td align=right>team 1</td>
<td align=center>v</td>
<td align=left>team 2</td>
</tr>

But it's a lot harder with pure CSS, unless I use fixed-width divs for
each cell - but I want to avoid that as I want the overall width to be
flexible and balanced. Any suggestions? Or is this one of the situations
where using a table is simply the best option?

Mark
--
http://mark.goodge.co.uk
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: CSS centred alignment
Old
  (#2)
:Jerry:
Guest
 
Posts: n/a
Default Re: CSS centred alignment - 06-02-2007, 08:53 PM


"Mark Goodge" <EMAIL REMOVED> wrote in message
news:46569b68$EMAIL REMOVED...
<snip>
>
> But it's a lot harder with pure CSS, unless I use fixed-width divs
> for each cell - but I want to avoid that as I want the overall width
> to be flexible and balanced. Any suggestions? Or is this one of the
> situations where using a table is simply the best option?
>


But isn't the example you give tabular data?......


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: CSS centred alignment
Old
  (#3)
Geoff Berrow
Guest
 
Posts: n/a
Default Re: CSS centred alignment - 06-02-2007, 08:53 PM

Message-ID: <46569b68$EMAIL REMOVED> from Mark Goodge
contained the following:

>This effect is easy to achieve with tables, like this...
>
><tr>
> <td align=right>team 1</td>
> <td align=center>v</td>
> <td align=left>team 2</td>
></tr>
>
>But it's a lot harder with pure CSS, unless I use fixed-width divs for
>each cell - but I want to avoid that as I want the overall width to be
>flexible and balanced. Any suggestions? Or is this one of the situations
>where using a table is simply the best option?


We shouldn't forget that tables are not inherently BAD. This table will
linearise just fine.

Furthermore, these rows MUST be kept together to be sensible, hence it
is (IMO) tabular data.



--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: CSS centred alignment
Old
  (#4)
Mark Goodge
Guest
 
Posts: n/a
Default Re: CSS centred alignment - 06-02-2007, 08:53 PM

:Jerry: wrote:
> "Mark Goodge" <EMAIL REMOVED> wrote in message
> news:46569b68$EMAIL REMOVED...
> <snip>
>> But it's a lot harder with pure CSS, unless I use fixed-width divs
>> for each cell - but I want to avoid that as I want the overall width
>> to be flexible and balanced. Any suggestions? Or is this one of the
>> situations where using a table is simply the best option?
>>

>
> But isn't the example you give tabular data?......


Probably. I don't have a pathological aversion to tables, I was just
wondering if I'd missed any obvious way of achieving the same effect in CSS.

Mark
--
http://mark.goodge.co.uk
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: CSS centred alignment
Old
  (#5)
paul watt
Guest
 
Posts: n/a
Default Re: CSS centred alignment - 06-02-2007, 08:53 PM


"Mark Goodge" <EMAIL REMOVED> wrote in message
news:46569b68$EMAIL REMOVED...
> I'm trying to create a list that's centred on a single character in the
> middle of the line - something like a fixture list, like this:
>
> Arsenal v Chelsea
> Liverpool v Manchester Utd
> West Ham v Reading
> Stoke City v Internazionale
> AFC Wimbledon v Hull
> Ajax v PSV Eindhoven
>
> (You'll need a monospaced font to see that correctly in this posting, but
> if you don't have that luxury then imagine it's aligned so that all the
> "v"s are in a single vertical line).
>
> This effect is easy to achieve with tables, like this...
>
> <tr>
> <td align=right>team 1</td>
> <td align=center>v</td>
> <td align=left>team 2</td>
> </tr>
>
> But it's a lot harder with pure CSS, unless I use fixed-width divs for
> each cell - but I want to avoid that as I want the overall width to be
> flexible and balanced. Any suggestions? Or is this one of the situations
> where using a table is simply the best option?
>
> Mark


Yep, Just use a table. Its tabular data afterall.
P.S. Its good to see that the mighty Reading fc have made it to this
newsgroup. Come on you Royals!

--
Paul Watt

http://www.paulwattdesigns.com


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: CSS centred alignment
Old
  (#6)
Simon Brooke
Guest
 
Posts: n/a
Default Re: CSS centred alignment - 06-02-2007, 08:53 PM

in message <4656a621$EMAIL REMOVED>, Mark Goodge
('EMAIL REMOVED') wrote:

> :Jerry: wrote:
>> "Mark Goodge" <EMAIL REMOVED> wrote in message
>> news:46569b68$EMAIL REMOVED...
>> <snip>
>>> But it's a lot harder with pure CSS, unless I use fixed-width divs
>>> for each cell - but I want to avoid that as I want the overall width
>>> to be flexible and balanced. Any suggestions? Or is this one of the
>>> situations where using a table is simply the best option?
>>>

>>
>> But isn't the example you give tabular data?......

>
> Probably. I don't have a pathological aversion to tables, I was just
> wondering if I'd missed any obvious way of achieving the same effect in
> CSS.


Personally, I think that one would be very tricky with CSS; not impossible
but not at all easy. Like others, I'd use a table.

--
EMAIL REMOVED (Simon Brooke) http://www.jasmine.org.uk/~simon/
Windows 95:
You, you, you! You make a grown man cry...
M. Jagger/K. Richards
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: CSS centred alignment
Old
  (#7)
Matt Probert
Guest
 
Posts: n/a
Default Re: CSS centred alignment - 06-02-2007, 08:53 PM

On Fri, 25 May 2007 09:19:38 +0100, Mark Goodge
<EMAIL REMOVED> wrote:

>I'm trying to create a list that's centred on a single character in the
>middle of the line - something like a fixture list, like this:
>
> Arsenal v Chelsea
> Liverpool v Manchester Utd
> West Ham v Reading
> Stoke City v Internazionale
> AFC Wimbledon v Hull
> Ajax v PSV Eindhoven
>
>(You'll need a monospaced font to see that correctly in this posting,
>but if you don't have that luxury then imagine it's aligned so that all
>the "v"s are in a single vertical line).
>
>This effect is easy to achieve with tables, like this...
>
><tr>
> <td align=right>team 1</td>
> <td align=center>v</td>
> <td align=left>team 2</td>
></tr>


So use tables!

It doesn't require a complex m*** of nested tables, and will still be
usable in character cell broswers and screen readers.

Matt


--
Want to consistently win at poker? Learn how here!

http://www.probertencyclopaedia.com/...N_AT_POKER.HTM
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: CSS centred alignment
Old
  (#8)
John Hosking
Guest
 
Posts: n/a
Default Re: CSS centred alignment - 06-02-2007, 08:53 PM

GreyWyvern wrote:
> And lo, John Hosking didst speak in alt.www.webmaster,uk.net.web.authoring:
>
>> Mark Goodge wrote:
>>> I'm trying to create a list that's centred on a single character in
>>> the middle of the line - something like a fixture list, like this:
>>> Arsenal v Chelsea
>>> Liverpool v Manchester Utd

>>
>>> This effect is easy to achieve with tables, like this...
>>> <tr>
>>> <td align=right>team 1</td>
>>> <td align=center>v</td>
>>> <td align=left>team 2</td>
>>> </tr>

>>
>> Tables, as discussed. But you don't need three cells per row, only two.

>
> How so? By placing the "v" with one of the two team names? That would
> distort the tabular data, and defeat the purpose of using the table in
> the first place. "Arsenal v" and "Chelsea"? "Liverpool" and "v
> Manchester Utd"?


Yes, that's rather what I meant. It's *not* clean semantically, but I
don't think I agree that it "defeats the purpose of using the table in
the first place", since the matches are still in the same row. But feel
free to persuade me.

>
> If, rather, you mean to have the middle <td> element only in the first
> row and have it "rowspan" through all the rows, that would make a little
> more sense, but it would still not convert to a sensible textual
> representation.


No, icky. Even ickier than my idea of a shortcut. And it wouldn't look
like what the OP was envisioning.

--
John
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: CSS centred alignment
Old
  (#9)
Jaya
Guest
 
Posts: n/a
Default Re: CSS centred alignment - 06-02-2007, 08:53 PM

Hi Mark goodge...

you can use simple tables to get these results...

<tr>
<td align=right width=50>Arsenal</td>
<td align=center width=5>Vs</td>
<td align=left width=50>Chelsea</td>
</tr>
<tr>
<td align=right width=50>Liverpool </td>
<td align=center width=5>Vs</td>
<td align=left width=50>Manshester United</td>
</tr>
<tr>
<td align=right width=50>West Ham</td>
<td align=center width=5>Vs</td>
<td align=left width=50>Ajax</td>
</tr>

the result u would get like this
Arsenal Vs Chelsea
Liverpool Vs Manshester United
West Ham Vs Ajax

Have fun
Aishwariya
http://www.monstertemplate.co.in
http://www.cd.monstertemplate.co.in

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: CSS centred alignment
Old
  (#10)
Andy Jacobs
Guest
 
Posts: n/a
Default Re: CSS centred alignment - 06-02-2007, 08:53 PM

On 25/5/07 9:19 am, in article 46569b68$EMAIL REMOVED, "Mark
Goodge" <EMAIL REMOVED> wrote:

> Ajax v PSV Eindhoven


<flippant>
Ajax is completely wrong.
</flippant>

That dealt with, why would you want to work really hard to avoid something
that is totally appropriate for your content?

--
Andy Jacobs
http://www.redcatmedia.co.uk

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top