Jump to content

Making a tables align to fit a layout width


LanceT

Recommended Posts

I'm working on a script that will display some tables side by side in a larger table. I want to make it so that they can align with each other no matter how many tables there are (the number of tables is set by the user).

 

To give you an example

 

1tablexk8.jpg

 

2tablesij9.jpg

 

3tablesdw1.jpg

 

4tablessn6.jpg

 

Thanks in advance!

i guess this is php if youre dynamically generating the outisde (white) table

 

that table would look like

 

<table>

<tr><td></td><td></td></tr> //these would be the rows and in between the td tags you'd place the blue tables

</table>

 

now in your loop while drawing the white table you have to keep a count of how many blue tables will be put inside of it

 

if the number is divisible by two, you add a </td></tr><td> if it isnt you just add </td><td>

 

hope that makes sense

 

the rest is styling. i would use pure css and divs, but do what you need to do

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.