Этой статьей я начну писать о своих успехах на поприще изучения веб разработки.
Итак начнем.
Я не хочу сказать что мое решение самое правильное, просто это одно из них.
Для начала следует вспомнить как верстается таблица на чистом HTML.
<table> <tr> <td>...</td> <td>...</td> <td>...</td> </tr> <tr> <td>...</td> <td>...</td> <td>...</td> </tr> </table>
Добавим к открывающему тегу table атрибуты - border='1' cellpadding = '5' width='30%', и посмотрим что у нас получилось
... | ... | ... |
... | ... | ... |
Теперь сделаем тоже самое, но с использованием php. Также давайте раскрасим клетки таблицы. Конечно лучше это делать средствами CSS, но попробуем так
index.php:
<?php
$rows = 10;//строки
$cols = 6;//столбцы
$table = "<table border='1' cellpadding = '3' width='50%'>";
$count = 0;//счетчик
for($i = 1; $i < $rows; $i++ ){
$table .= "<tr align='center'>";
for($j = 1; $j < $cols; $j++ ){
$count++;
if(($count%2)=== 0) {
$table .= "<td bgcolor='yellow'>$count</td>";
} else {
$table .= "<td>$count</td>";
};
};
$table .= "</tr>";
};
$table .= "</table>";
echo $table;
?>
А вот что должно получится:
Ну вот как-то так, делитесь своими замечаниями.
In this fashion my pal Wesley Virgin's tale begins in this shocking and controversial VIDEO.
ОтветитьУдалитьWesley was in the military-and soon after leaving-he found hidden, "mind control" tactics that the CIA and others used to obtain whatever they want.
THESE are the same tactics many celebrities (notably those who "come out of nothing") and top business people used to become rich and successful.
You probably know that you use only 10% of your brain.
Really, that's because the majority of your BRAINPOWER is UNCONSCIOUS.
Maybe this expression has even occurred INSIDE your very own brain... as it did in my good friend Wesley Virgin's brain about seven years ago, while riding an unregistered, trash bucket of a car with a suspended license and $3 on his bank card.
"I'm so frustrated with going through life paycheck to paycheck! When will I get my big break?"
You've taken part in those thoughts, ain't it so?
Your own success story is going to happen. You just have to take a leap of faith in YOURSELF.
Take Action Now!