Is there a table column<tc> instead of Table row <tr>?

Hello,

I am hoping there is a way to place the number from top to bottom.

Here is a sample from the code in simple HTML

[code]















1 2 3 4 5
6 7 8 9 0
[/code]

Result will be:
12345
67890

but I need is this one.

	<table>
<tr>
<td>
<table border = 1> 
		<tr><td>1</td></tr>
		<tr><td>2</td></tr>
		<tr><td>3</td></tr>
		<tr><td>4</td></tr>
		<tr><td>5</td></tr>
</table>
</td>
<td>
<table border = 1> 
		<tr><td>6</td></tr>
		<tr><td>7</td></tr>
		<tr><td>8</td></tr>
		<tr><td>9</td></tr>
		<tr><td>0</td></tr>
</table>
</td>
</tr>
</table>

The result should be
1 6
2 7
3 8
4 9
5 0

Is this possible? I need the code because I will use it in PHP. Thanks in Advance

Simple answer, no. What are you actually trying to do. Using a for loop, or a counter it is actually quite easy to implement.

Why not [member=72272]astonecipher[/member]? Just one of several ways.

[php]<?php
$arr = array(‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ‘0’);

$max_num_cols = 2;
$min_items_per_col = 5;
$col_limit_calculation = $max_num_cols * $min_items_per_col;
$num_rows = count($arr);

$chunk_count = ($num_rows >= $col_limit_calculation) ? ceil(($num_rows / $max_num_cols)) : $min_items_per_col;

$alphabet_chunk_array = array_chunk($arr, $chunk_count);

echo “<table border=“1”>

”;
foreach ($alphabet_chunk_array as $alphabet_array) {
echo “<td valign=“top”>”;
foreach ($alphabet_array as $alphabet) {
echo $alphabet . “
”;
}
echo “”;
}
echo “”;
?>[/php]

Not what your asking for, but have some fun with this.

[php]

<?php for($x=1; $x<=20; $x++) { echo ""; for($y=1; $y<=20; $y++) { echo ""; } echo ""; } ?>
"; echo $x*$y; echo "
[/php]

Wow thanks. This might come in handy… :slight_smile:

Thanks a lot Sir Kevin, I tried it and a little tweak and it works. Thanks!

Kevin, you just did what I stated. The no portion, there still isn’t a tc element, that I am aware of anyway.

LOL! For some reason I didn’t read the whole last sentence. Yep, no tc element.

Sponsor our Newsletter | Privacy Policy | Terms of Service