Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 tables side by side 1

Status
Not open for further replies.

simon551

IS-IT--Management
May 4, 2005
249
hi. I need to format my page to show 2 tables next to each other for printing. I don't think I can use a float because of the printing problem in firefox. My data comes from a database and I'm using php. This is my code which works to generate 2 html tables from the same source (mysql) table.


what I want to do is show a list like 1.2.3.4.5.6 as:

1 4
2 5
3 6

not sure if the php code here will help to demonstrate my problem but I'm hoping it does:
Code:
echo
'<table>';
foreach ($array as $key=> $check) { 
if ($key<($midpoint)){
echo 
    '<tr>'
      .$array[$key].
    '</tr>';
   } 
}
echo
'</table>';


//second table I would like to view next to the first
echo
'<table>';
foreach ($array as $key=> $check) { 
if ($key>($midpoint)){
echo 
    '<tr>'
      .$array[$key].
    '</tr>';
   } 
}
echo
'</table>';
 
I never have trouble printing floated elements in FF. Just make sure there's actually enough space for the two elements to float next to each other. Not just on screen, but on paper too.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
what if I wanted to do more than 2 tables? is that possible?

for example:
1 4 7 10
2 5 8 11
3 6 9 12
 
As long as the tables are small enough to fit the paper, it should work. Though for your example I could say a maximum of one table with four columns or no tables at all.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top