Grid Resizes/Shrinks For Column Count 4 or Less

Grid Resizes/Shrinks For Column Count 4 or Less

mishrasmishras Posts: 3Questions: 0Answers: 0
edited October 2010 in General
Hi,
Newbie here, I'm using the DataTable plugin with Zero Configuration. The plug-in rocks, but I'm facing a problem: The table grid shrinks automatically to 1/2 the container size, if the total no. of columns is less than 4.

For example:
When there are about 7 columns, my grid looks like this (figure 1):

Show Search
col1 col2 col3 col4 col5 col6 col7

However, when there are about 4 columns, my grid looks like this (figure 2):

Show Search
col1 col2 col3 col4

How can I make the grid in figure 2 look like figure 1, with 4 or fewer number of columns?

Thanks.

Replies

  • mishrasmishras Posts: 3Questions: 0Answers: 0
    edited October 2010
    Ah, forum formatting stripped off the spaces that I had put in to create the problem layout. So here I go again:

    I've 4 cols in my Datatable. In page, they show up:
    Show---------------------------------------------------------------------Search
    col1 col2 col3 col4

    How can I make them use the entire width of the Datatable? Something like below:
    Show---------------------------------------------------------------------Search
    col1 col2 col3 col4

    Thanks.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    If you add

    [code]
    table { width: 100%; }
    [/code]
    to your CSS, does that let it work?

    Allan
  • mishrasmishras Posts: 3Questions: 0Answers: 0
    Thanks Allan, that worked.
This discussion has been closed.