Jump to content
  • 0

Проблема: ширина ячеек в таблице


StrangeRRor
 Share

Question

Прошу прощения за нубский вопрос, но сам не пойму в чем проблема.

В таблице один ряд из семи ячеек. Первые и последние три ячейки имеют фиксированную ширину. Центральная ячейка должна занимать всё пространство, не занятое остальными ячейками, но, если устанавить ей ширину 100%, то она начинает занимать всю область таблицы, игнорируя ширину остальных ячеек.

<html>
<head>
</head>
<body>
<table height="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="10" height="100%" bgcolor="#7CFC00">
</td>
<td width="150" height="100%" bgcolor="#8B4513">
</td>
<td width="10" height="100%" bgcolor="#D2691E">
</td>
<td width="100%" height="100%" bgcolor="#8B8682">
</td>
<td width="10" height="100%" bgcolor="#7CFC00">
</td>
<td width="150" height="100%" bgcolor="#8B4513">
</td>
<td width="10" height="100%" bgcolor="#D2691E">
</td>
</tr>
</table>
</body>
</html>

Edited by StrangeRRor
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' lang='ru' xml:lang='ru'>
<head>
</head>
<body>
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" style="table-layout: fixed;">
<col width="10" /><col width="150" /><col width="10" /><col width="100%" /><col width="10" /><col width="150" /><col width="10" />
<tr>
<td bgcolor="#7CFC00">
</td>
<td bgcolor="#8B4513">
</td>
<td bgcolor="#D2691E">
</td>
<td bgcolor="#8B8682">
dfgdfg
</td>
<td bgcolor="#7CFC00">
</td>
<td bgcolor="#8B4513">
</td>
<td bgcolor="#D2691E">
</td>
</tr>
</table>
</body>
</html>

Link to comment
Share on other sites

  • 0
А мне откуда знать, что тебе думается? :)

Хм..., вот поэтому я и выложил свою мысль. :P

Вот так будет лучше:

<head>
<style>
html,body {
margin:0;
padding:0;
width:100%;
height:100%;
}
</style>
</head>

Edited by rus
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy