Experts Exchange connects you with the people and services you need so you can get back to work.
<?php // RAY_temp_3rows.php
// SEE http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/CSS/Q_27296422.html?cid=1572
// SEE http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/CSS/Q_27296422.html?cid=1572#a36502708
// SET UP AN ARRAY OF STUFF TO PUT INTO TABLES
$things = array
// SET THE NUMBER OF ROWS
$rows = 3;
// A PLACE TO PUT THE TABULAR DATA
$dat = array();
// MAKE A MATRIX FROM THE ARRAY OF STUFF
$col = 0;
$row = 0;
while ($row < $rows)
$dat[$row][$col] = array_shift($things);
// ACTIVATE THIS TO SEE THE MATRIX
// CONSTRUCT THE TABULAR INFORMATION FROM THE MATRIX
$htm = '<table>' . PHP_EOL;
foreach ($dat as $arr)
// START A ROW
$htm .= '<tr>';
foreach ($arr as $str)
// ADD THE DATA TO THE ROW
$htm .= '<td>' . $str . '</td>';
// CONCLUDE THE ROW
$htm .= '</tr>' . PHP_EOL;
$htm .= '</table>' . PHP_EOL;
// SHOW THE WORK PRODUCT
Open in new window
Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Premium members get this course for $349.00.
Premium members get this course for $95.20.
Premium members get this course for $159.20.
Premium members get this course for $143.20.
Premium members get this course for $62.50.