You are here: CSS equivalent of single-cell table ? « HTML « IT news, forums, messages
CSS equivalent of single-cell table ?

Posted by MangroveRoot on 11/01/07 23:01

I've looked for tutorials on how to do this for some years,
with no success.

Most of the time, I'm a good boy and only use <TABLE> (etc)
to format tabular data.

However, there remains one thing that <TABLE> does excellently
that I have yet to find a way to do using solely CSS:

Put a block of text *in a box*,
which box sizes itself to the size of the *content*,
not to some arbitrary fixed width or some percentage of the window.

E.g., the equivalent of:

<table border="5" frame="inset">
<tr><td bgcolor="red">
content
</td></tr>
</table>

I've tried things like:

<div style=" align:center;
border-width:5;
border-style:inset;
background-color:red;
">
content
</div>

but this (a) creates a box that takes up the entire width of the window,
leaving the content looking a little bit orphaned in the middle;
and (b) doesn't produce the same coloration of the border
(specifically, it produces black and grey,
instead of light-page-background and dark-page-background).

Surely CSS can do this; how?

 

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

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