You are here: Re: Tables as rectangular screen areas « HTML « IT news, forums, messages
Re: Tables as rectangular screen areas

Posted by dorayme on 09/15/06 02:33

In article <0mmOg.2012$IA.1107@newssvr11.news.prodigy.com>,
dfloss <dfloss@imap.com> wrote:

> This is bad form, but it works. Is there a better way to border-ize a
> rectangle of unknown size?
>
> <html>
> <body>
> <div>
> <table style="margin-left: auto; margin-right: auto; border-bottom:
> 2px solid; border-color: #999" cellspacing="0" cellpadding="0">
> <tr style="font-size: x-large; font-weight: bold"><td>Here is some
> text</td></tr>
> <tr style="font-size: xx-small"><td>&nbsp;</td></tr>
> </table>
> </div>
> </body>
> </html>
>
> ... insert spacers as needed


Perhaps you are having trouble styling a div the way you want
because a div is by default 100% wide, even if the content is
not. The div does not naturally shrink to the width of the
content. To make it do so, one method is to estimate the width of
the content - if it is text, em based width is pretty good - and
then assign similar to a width specification to the div (with
appropriate allowances like padding, perhaps a bit to spare etc).


<div style="margin-left: auto; margin-right: auto; border-bottom:
2px #999 solid;width:9em;">
Here is some text
</div>

--
dorayme

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация