[UPHPU] Table width

Wade Preston Shearer wadeshearer.lists at me.com
Sun Jun 14 17:05:06 MDT 2009


On 12 Jun 2009, at 17:00, Scott Hill wrote:

> I need to construct an HTML table (for use with tabular data only of  
> course)
> that will have a variable number of columns.  I want to adjust the  
> width of
> the table depending on the width of the browser screen.  In other  
> words, I
> don't want the user to have to scroll horizontally to see the right  
> end of
> the table.  Instead I want to have a small drop down button in the  
> top right
> corner that the user can click and see and/or select the remaining  
> columns.
> I have seen this done before but I can't remember where or how.

I would recommend using jQuery. Detecting the browser width and  
showing as many columns will fit is quite easy. You can write it all  
from scratch or start with some of the great data table plug-ins out  
there, such as these:

http://www.datatables.net/examples/example_hidden_columns.html
http://www.flexigrid.info/


This plug-in provides the ability to hide the columns (still there and  
searchable). You would simply have to write the part that detects the  
width, hides those that don't fit, and create a drop-menu for  
replacing visible ones with hidden ones.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2431 bytes
Desc: not available
Url : http://uphpu.org/pipermail/uphpu/attachments/20090614/17c05d6f/smime.bin


More information about the UPHPU mailing list