Php table

Hi guys how to i place 2 tables side by side ir is it possible to position absolute a php table ?

What is a “PHP table”? PHP doesn’t really display anything, but mostly generates e.g. HTML that supports tables, and HTML ist styled via CSS, that supports placing elements next to each other with e.g. css-grids, or oldschool with float.

I don’t understand your question properly. If you want use table inside php… look at the below code. It may be help you.

<?php
	echo "<table style='width:100%;'><tr><td>";
	echo "<table>";
	echo "<thead><th>Table 1 Left</th></thead>";
	echo "<tbody><tr><td>Content 1 Left</td><tr></tbody>";
	echo "</table>";
	echo "</td><td>";
	echo "<table>";
	echo "<thead><th>Table 2 Right</th></thead>";
	echo "<tbody><tr><td>Content 2 Right</td><tr></tbody>";
	echo "</table>";
	echo "</td></tr>";
	echo "</table>";
	?>

Sorry i will try to explain i have took a screenshot of the page. The contact delivery and payment is in a table with no border.
The order no is in another table with no border below this. How do i get this table to sit at the side of the table above ?

@salnazi, for gawd sake, NO!

1 Like

updated pic the contact delivery and payment are in a table with no border. The account and no are in another table below with no border. I want the table below to be at the side of the table above as shown by the arrows

No one can see that stupidly small image. Make an effort to help us… help you!

You have posted ZERO code… so how can anyone help you with what you are doing? (when you havent SHARED what you are doing?)

Is the top table a set width? is there any room on the right side for this new table?

Have to tried floating the table? or aligning the table?

Or even set the display to inline? or perhaps table-cell?

What have you tried?

Please share your code and let us know your expected output.

i have managed to sort this thanks for your help.

if i have a simple form 2 fields name and address the form field is named name1 and address1

how do i put a link to add an extra line to the form and it automatically adds another name and address but renames the fields name2 and address 2 and again if i add another line it renames the fields name3 and address3

Thanks

You won’t need to rename anything if you just use arrays, a form field name can be adress[] too and PHP will make an array from that. So with Javascript you can onclick append elements to the DOM with appendChild().

Sponsor our Newsletter | Privacy Policy | Terms of Service