SoftoRooM LifeRooM Whois RSS GZip WAP Поиск Правила Помощь Disclaimer
Твой софтовый форумТвой софтовый форумТвой софтовый форумТвой софтовый форум

Здравствуйте Гость ( Вход | Регистрация )

Работа с таблицами


 
post 12.03.2008 - 23:26
Отправлено #1
Wak



Опытный юзверь
**

Профиль
Группа: Пользователи
Сообщений: 61
Регистрация: 27.07.2006
Пользователь №: 201.587


Респектов: 0
----------


Предупреждений:   1


Как сделать, что бы выполнялся следующий код:


Если ... то таблица имеет вид

Code

<table border="1" width="100" height="100">
<tr>
 <td height="50" width="50">
 <p align="center">1</td>
 <td height="50" width="50">
 <p align="center">2</td>
</tr>
<tr>
 <td height="50" width="50">
 <p align="center">3</td>
 <td height="50" width="50">
 <p align="center">4</td>
</tr>
</table>



иначе:

Code

<table border="1" width="100" height="100">
<tr>
 <td height="100" width="100">
 <p align="center">0</td>
</tr>
</table>

???
User is offlineProfile CardPM
Go to the top of the pageGo to the end of the page
+Quote Post

Reply to this topicStart new topicStart Poll
Ответов(20 - 24)
 
post 19.03.2008 - 23:39
Отправлено #21
Wak



Опытный юзверь
**

Профиль
Группа: Пользователи
Сообщений: 61
Регистрация: 27.07.2006
Пользователь №: 201.587


Респектов: 0
----------


Предупреждений:   1


С таким же успехом можно было дать ссылку на букварь. Конечно, я знал, что нужно использовать структуру "if ... then ... else ...". Я пытался реализовать данную задачу посредствам JS, но однократно используя процедуру "document.write". В этом, собственно говоря, и была проблема.
User is offlineProfile CardPM
Go to the top of the pageGo to the end of the page
+Quote Post

 
post 19.03.2008 - 23:47
Отправлено #22
de1ay



Cardable Unit
[SoftoRooMTeaM] Group Icon

Профиль
Группа: СуперМодераторы
Сообщений: 3.893
Регистрация: 14.10.2005
Из: EU
Пользователь №: 1.010


Респектов: 626
-----XXXX-




А почему конкретизировать нельзя изначально?
User is offlineProfile CardPM
Go to the top of the pageGo to the end of the page
+Quote Post

 
post 20.03.2008 - 23:04
Отправлено #23
Wak



Опытный юзверь
**

Профиль
Группа: Пользователи
Сообщений: 61
Регистрация: 27.07.2006
Пользователь №: 201.587


Респектов: 0
----------


Предупреждений:   1


Да уж, почему бы не конкретизировать?
Цитата | Quote
if  <условие>
{
1 таблица
}
else
{
2 таблица
}

и
Цитата | Quote
if (условие) оператор1 else оператор2
User is offlineProfile CardPM
Go to the top of the pageGo to the end of the page
+Quote Post

 
post 21.03.2008 - 2:06
Отправлено #24
Hydrargyrum



профи!
[SoftoRooMTeaM] Group Icon

Профиль
Группа: Дружинники
Сообщений: 711
Регистрация: 15.02.2006
Из: Питера
Пользователь №: 23


Респектов: 332
-----XX---




Wak, не суетись... wink.gif
Тебя не устроил мой ответ?

Code
<script language="JavaScript">
if (i==1){
document.write("<table border='1' width='100' height='100'><tr><td height='50' width='50'><p align='center'>1</td><td height='50' width='50'><p align='center'>2</td></tr><tr><td height='50' width='50'><p align='center'>3</td><td height='50' width='50'><p align='center'>4</td></tr></table>");
}
else
{
document.write("<table border='1' width='100' height='100'><tr><td height='100' width='100'><p align='center'>0</td></tr></table>");
}
</script>
User is offlineProfile CardPM
Go to the top of the pageGo to the end of the page
+Quote Post

 
post 21.03.2008 - 9:56
Отправлено #25
de1ay



Cardable Unit
[SoftoRooMTeaM] Group Icon

Профиль
Группа: СуперМодераторы
Сообщений: 3.893
Регистрация: 14.10.2005
Из: EU
Пользователь №: 1.010


Респектов: 626
-----XXXX-




Цитата | Quote(Wak @ 20.03.2008 - 23:04)
Да уж
*

Каков вопрос таков ответ, не находите?
User is offlineProfile CardPM
Go to the top of the pageGo to the end of the page
+Quote Post


Reply to this topicTopic OptionsStart new topic
 


  Яндекс цитирование   Rambler's Top100
LITE - версия | WAP - версия