Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a page grid with 5 columns. When it has six items there is only one TD for the second row which makes the grid look like this:
Firefox 3.0.10
+----+----+----+----+----+
| | | | | |
| | | | | |
+----+----+ | | |
| | | | |
| | | | |
+----+
IE8
+----+----+----+----+----+
| | | | | |
| | | | | |
+----+----+----+----+----+
| |
| |
+----+
I want it to display all 5 cells on both rows, even if it will be 4 empty ones on row 2.
I suppose this is a bug...
Comment | File | Size | Author |
---|---|---|---|
#24 | grid-fix_3.patch | 487 bytes | dawehner |
#20 | Picture 1.png | 186.2 KB | leducmills |
#13 | grid-fix.patch | 1.2 KB | superbaloo |
#12 | grid-fix.patch | 1.17 KB | superbaloo |
#9 | grid-fix.patch | 1.17 KB | superbaloo |
Comments
Comment #1
mstef CreditAttribution: mstef commented+1...
definitely should be fixed...
not sure how to do it yet but i'll look now
Comment #2
dawehnerHere is an initial patch, but it works only for horizontal grids currently.
Comment #3
mstef CreditAttribution: mstef commentednice work dereine..works perfectly...i looked at it quickly and couldn't figure it out at first..
thanks
Comment #4
dawehnerBut this does not fix the vertical display of the grid style.
Comment #5
superbaloo CreditAttribution: superbaloo commentedHere is a patch for both vertical and horizontal,
Including the dereine's one :)
Comment #6
mstef CreditAttribution: mstef commentedlooks good...nice work too
Comment #7
dawehnerBut this does not fix the vertical display of the grid style.
Comment #8
dawehnerdamn, there was something in my browser cache since this afternoon.
Why $rows[1] and not $rows[0].
I would use only "=" here
I'm on crack. Are you, too?
Comment #9
superbaloo CreditAttribution: superbaloo commentedSorry for this, you were right :)
Comment #10
dawehnerIf the item is "0" this will return TRUE and replaced with ''.
This review is powered by Dreditor.
Comment #11
dawehnerneeds work :)
Comment #12
superbaloo CreditAttribution: superbaloo commentedLol !
here it's fixed !
sorry for useless iterations
Comment #13
superbaloo CreditAttribution: superbaloo commentedPatch seems not to apply, don't know why ...
Here is a patched version ! :p
Comment #14
dawehnerI would think thats its rtbc, if its not by design ;)
I think tables has to be completed, so fixing this would be good.
Comment #15
dawehner.
Comment #16
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted.
Note ++ is a unary operator and therefore shouldn't have had a space.
Comment #17
mstef CreditAttribution: mstef commentedEverything works great with this patch besides one thing...
If there is only one row in the grid output, the patch now causes it to add additional empty td's. This is only necessary if there is more than one row.
Comment #18
merlinofchaos CreditAttribution: merlinofchaos commentedBetter make it active. 'needs work' can be kind of a wasteland if no one is specificly working on it.
Comment #19
joanpc CreditAttribution: joanpc commentedI don't like empty cells unless they have an empty class or something to make them disappear from CSS
Comment #20
leducmills CreditAttribution: leducmills commentedIs it possible that this could be causing empty cells to show up on grid views? (see attached -- notice the last two cells) Just happened when I updated to the latest views version.
Any fixes to get rid of this? I just want blank space.
Thanks!
Comment #21
joanpc CreditAttribution: joanpc commentedyes It does!
I fixed similar issue making a custom views template to not display empty cells.
views-view-grid.tpl.php
IMHO: No displaying empty cells is ok. Firefox don't know how to display these kind of tables, is a firefox bug. But you can fix the borders with some css.
IE and Safari display these tables well.
Comment #22
Bilmar CreditAttribution: Bilmar commentedsubscribing
Comment #23
joanpc CreditAttribution: joanpc commentedMaybe the best way is to add an option to enable/disable displaying empty cells in the grid style config of the view.
It will be useful to have the both options. Without forgetting to add some kind of "empty-cell" css class to empty cells.
but that's a feature request..
Comment #24
dawehnerHere is a patch which fixes this
Comment #25
merlinofchaos CreditAttribution: merlinofchaos commentedFix committed to all branches. Thanks dereine!