Here's a simple patch to cover this.
Widths are rounded to two decimal places.

CommentFileSizeAuthor
views-7x-3x-views-view-grid-tpl.patch771 byteswjaspers

Comments

dawehner’s picture

Status: Active » Needs work

This should be really optional, this will break css from a lot of people.

merlinofchaos’s picture

But really cool so I highly encourage getting this to work in a way that will be good for people upgrading as well as people going forward!

wjaspers’s picture

@dereine In most cases CSS takes precedence over structural values (td { width: x; } will override <td width="x">), but I see what you're saying, especially if others are depending on that value not being present.

@merlinofchaos How would you feel about having the whole output plugin modified so that it generated <div>'s instead of a table? or for reverse-compatibility, provided an option to switch between divs or a table? Then we somehow add a width setting on each "column"...

From a semantic standpoint, it might be more appropriate than a table.......it'll probably take some time to piece this idea together...but lots of food for thought.

Any feedback from other readers is always encouraged!

merlinofchaos’s picture

It would need to be optional. Changing the structure significantly would impact people's markup and CSS code pretty severely. Plus, sometimes the table really is better.

lifepillar’s picture

+1 for this feature. If changing the current grid has too many implications, how about adding a new (div-based) “proportional grid” or something like that?

wjaspers’s picture

That was the thought. I havent gotten to it yet, though.

jdufaur’s picture

+1 subscribe

summit’s picture

Hi, In drupal 6 this was suggested: http://drupal.org/node/354124
It didn't work on Bartik on D7. I tried:

/* ------------------ Table Styles ------------------ */
table {
  border: 0;
  border-spacing: 0;
  font-size: 0.857em;
  margin: 10px 0;
  width: 100%;
  //http://drupal.org/node/354124
  table-layout:fixed;
}

Adding table-layout:fixed;
It didn't work..
Thanks for going into this in advance,
greetings, Martijn