Currently the lines in ezTable are controlled by an option 'showLines', which has a fixed number of hard to remember variants.
I have implemented locally a replacement for this option, I called it 'gridlines', which acts as a bitmask controlling the different lines. I defined some constants,
define('EZ_GRID_OUT', 8); // Table outline
define('EZ_GRID_HD', 4); // Horizontal line between headings and table body when showHeadings
define('EZ_GRID_H', 2); // horizontal lines between data rows
define('EZ_GRID_V', 1); // vertical lines between data columns
that can be added together to provide the required style. The current 'showLines' values can be 'translated' to these in order to preserve compatibility.
If you like this approach, I can provide a patch for it. I'm not sure if further refinement would be useful, like e.g. separating horizontal and vertical outlines, or odd/even row lines or anything else. There are more bits available :)
Please comment.
Emil
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The more I think, the more I tend to split table gridline into EZ_GRIDLINE_TABLE_H and EZ_GRIDLINE_TABLE_V parts, so I will do this, change the names and send the patch.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Patch #20 created. You can change the names of options and constants as you like.
I am also not 100% sure in the compatibility translation of 'showLines' values.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Currently the lines in ezTable are controlled by an option 'showLines', which has a fixed number of hard to remember variants.
I have implemented locally a replacement for this option, I called it 'gridlines', which acts as a bitmask controlling the different lines. I defined some constants,
define('EZ_GRID_OUT', 8); // Table outline
define('EZ_GRID_HD', 4); // Horizontal line between headings and table body when showHeadings
define('EZ_GRID_H', 2); // horizontal lines between data rows
define('EZ_GRID_V', 1); // vertical lines between data columns
that can be added together to provide the required style. The current 'showLines' values can be 'translated' to these in order to preserve compatibility.
If you like this approach, I can provide a patch for it. I'm not sure if further refinement would be useful, like e.g. separating horizontal and vertical outlines, or odd/even row lines or anything else. There are more bits available :)
Please comment.
Emil
that is a nice approach but I would name a bit more user friendly:
For instance:
EZ_GRIDLINE_TABLE
EZ_GRIDLINE_HEADERONLY
EZ_GRIDLINE_ROWS
EZ_GRIDLINE_COLUMNS
Would you agree to this?
No problem, I am a bit lazy typing :)
The more I think, the more I tend to split table gridline into EZ_GRIDLINE_TABLE_H and EZ_GRIDLINE_TABLE_V parts, so I will do this, change the names and send the patch.
Well EZ_GRIDLINE_TABLE is double IMO (GRID vs. TABLE). let us use my definition please ;-)
I am already thinking to provide some more definition in future.
For instance:
and for shading
maybe some days shading will be also available for ezText, thats why I used EZ_SHADING and not EZ_GRID_SHADING
Patch #20 created. You can change the names of options and constants as you like.
I am also not 100% sure in the compatibility translation of 'showLines' values.