Re: center/shrink to fit redux.



"fred.haab@xxxxxxxxx" <fred.haab@xxxxxxxxx> wrote:
news:1149177394.723897.252920@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

So I'm anally trying to avoid tables, like all the "good" developers
keep saying I should, but with all my books and searching on the
web, I simply can't figure out a way to center an <ul> without
using a table.

So the "requirement" is that the UL block itself is centered AS A
WHOLE. The actualy content within the block should be left aligned
(the bullets should line up). The title I have above the UL is
pretty short - and should also be left aligned (but I could live
with it centered over the list). So it's something basic like this:


[snip]

The first thing that comes to mind is display:table. Work around would be needed
for IE.

<style type="text/css">
..table{
display:table;
margin:auto;
}
..table p{
margin: 0;
}
ul,li{
margin:0 0 0 5px;
padding:0 0 0 5px;
}
</style>

<div class="table">
<p>List Title:</p>
<ul>
<li>Item 1.</li>
<li>Item two is a lot longer.</li>
<li>Item three is, also.</li>
</ul>
</div>

I can think of a way or two that may work in IE.

If you wish to allow IE to display just a bit different, then you could assign a width
to the table class for IE, the result would be almost the same but will not shrink ,
and could be a real pain if you have several of these on a page because you may
need to play with the width to get the results you want.

<!--[if IE]>
<style type="text/css">
..table{width:10.5em}
</style>
<![endif]-->

The work around I am going to suggest is not likely to be very popular, since it
will not get you away from a table.

<div class="table">
<!--[if IE]>
<table summary="Broken IE layout" style="margin:auto;"><tr><td>
<![endif]-->
<p>List Title:</p>
<ul>
<li>Item 1.</li>
<li>Item two is a lot longer.</li>
<li>Item three is, also.</li>
</ul>
<!--[if IE]>
</tr></td></table>
<![endif]-->
</div>

Another option for IE would be to use an css expression, but that would be
dependent on Jscript.

--
BootNic Thursday, June 01, 2006 5:55 PM

The only thing wrong with immortality is that it tends to go on
forever.
*Herb Caen*


.



Relevant Pages

  • Re: Must learn how to write VBA.
    ... motivation and why Access contains many of the features it does. ... books, manuals, periodicals, and other documents for the department. ... there in Access and that motivated developers can dig into the product ... The Object Browser is ...
    (microsoft.public.access.gettingstarted)
  • Re: Trashy (was: bn)
    ... > I think you're saying that every time you use the word "trashy". ... When I wrote "I'm not saying these books ... A novel which involved an evil killer Buddhist ... Matthew Huntbach ...
    (alt.usage.english)
  • Re: English Translation Lacks Verve
    ... photons to travel coherently in saying: ... It's a reference to the pretty books that people keep on their ... Japanese that says a movie is pretty translated as a coffee table book kept ...
    (sci.lang.japan)
  • Re: "Six ways to Sunday" origin?
    ... According to The old saying, he looks nine ways for Sunday ... turns up Grose's Vulgar Tongue books, ... Or the bad OCR in general? ...
    (alt.usage.english)
  • Re: the chronology of the 70 week prophecy
    ... > listen to what the Spirit is saying. ... > "Therefore judge nothing before the appointed time; wait till the Lord ... > wondrous *love* of God contained throughout the rest of Scripture. ... these books were written for our benefit. ...
    (uk.religion.christian)