You are here: Re: table issue, centered column not possible, when text in other columns « HTML « IT news, forums, messages
Re: table issue, centered column not possible, when text in other columns

Posted by dorayme on 09/01/07 21:35

In article
<1188674658.268032.18170@50g2000hsm.googlegroups.com>,
joes <joes@bluewin.ch> wrote:

> Hello
>
> I have strange issue with tables. I like to have table with 3 columns
> where the middle column is fixed an the other 2 columns are relative,
> using the rest max width. Effect is that the middle area is centered.
> So far no issue, Example


> <table width="100%" border="1" cellspacing="0" cellpadding="0">
> <tr>
> <td>&nbsp;</td>
> <td width="704">centered column</td>
> <td>&nbsp;</td>
> </tr>
> </table>


Columns mostly have different priorities to us. They listen
foremost to the demands of their contents. Your type of snippet
in more context:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Question</title>
<style type="text/css">
..centreCol {width: 704px;}
</style>
</head>
<body>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>A whole lot of words, some big like
antidisestablishmentarianism and other things?</td>
<td class="centreCol">centered column</td>
<td>tiny</td>
</tr>
</table>
</body>
</html>

I have replaced your width instruction with a css one. It is more
correct in this context.

What you see as a default when you have minimal content is not an
indication of what to expect generally. It is not how tables
work.

If you are wanting to layout a webpage rather than exhibit some
relationships as in your average spreadsheet, then there are
quite a few ways to go to get what you want. Google for "3 column
layouts CSS".

--
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

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