Jump to content

Resizing tables using php


MoombaDS

Recommended Posts

Not entirely sure whether to stick this under the Maths section but anyway:

 

I was wondering if anyone can show me a PHP script (My php scripting skills are pretty basic) that would calculate the height of a table (the height of the table isn't defined, it resizes with content), divide the height by 142, round the answer up to the nearest whole number and then multiply that answer by 142 before finally setting the height of the table in question to that final answer.

 

e.g. Table Height is 390

 

Dividing 390 by 142 gives 2.75 (roughly)

 

Round 2.75 up to 3.

 

Multiply 3 by 142 gives 426.

 

Set the table height to 426.

 

If anyone could help me on this I would be eternally greatful.

 

Thank you.

Link to comment
Share on other sites

But what you wanna do is not possible since PHP is serverside and the "resizes with content" is done client side based on lots of things like the users browser window, browser font size ect.

 

So you can't get PHP to obtain the height of a table, calculate a new height and display the table again... not possible :)

Link to comment
Share on other sites

mmm you're right about that. I forgot to think about it.

 

Problem I'm having is here:

 

http://www.ffinsight.com/uploads/index2.php

 

You'll notice near the bottom that there's a line where the repeating background cell doesn't mesh with the footer.

 

The repeating cell is actually designed to mesh with the footer, but only if it repeats to it's full height (the height is 142px, so the table height would need to be a multiple of 142).

 

This was one of the only ways I could think of correcting it, having been unable to find a solution in HTML or CSS.

 

Is there any way to force the table to only ever increase by 142px?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.