wanjidong / jmesa

Automatically exported from code.google.com/p/jmesa
0 stars 0 forks source link

Empy cells don't show border #195

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The way that the empty cells are rendered (as </td> ) makes them not able
to have border.
If you set this as in a example of the Renderes wiki page:
table.getTableRenderer().setBorder("1px");
(And you disable the default coloured borders that the cells have)
The empty cells won't have border. This is a CSS problem between the
browsers, I think. You can fix it in Firefox like this:
.jmesa .table {
    empty-cells: show;
}
But that doesn't work in IE6 or IE7.
Is there any chance that the empty cells would be rendered like this?
<td> &nbsp </td>
I think this may fix the problem, not having to wait for IE8 that seems to
follow the necesary CSS standard for "empty-cells".

Someone correct me if I'm wrong

Cheers,
Alex

Original issue reported on code.google.com by AlejaV...@gmail.com on 13 May 2009 at 3:41

GoogleCodeExporter commented 8 years ago
Maybe something like this in the HtmlCellRendererImpl?

    public Object render(Object item, int rowcount) {
        HtmlBuilder html = new HtmlBuilder();
        html.td(2);
        html.width(getColumn().getWidth());
        html.style(getStyle());
        html.styleClass(getStyleClass());
        html.close();

        String property = getColumn().getProperty();
        Object value = getCellEditor().getValue(item, property, rowcount);
        if (value != null) {
            html.append(value.toString());
        }
        //*****************
        else {
            html.nbsp();            
        }
        //*****************

        html.tdEnd();

        return html.toString();
    }

Original comment by AlejaV...@gmail.com on 13 May 2009 at 4:29

GoogleCodeExporter commented 8 years ago
This is a good improvement, and actually something that I thought was already in
place. Good catch! I will implement this on the trunk this weekend.

Feel free to submit code patches (as a file) as well. All the IDE's make it 
very easy
to do and it is the easiest way for me to integrate changes.

Original comment by jeff.johnston.mn@gmail.com on 14 May 2009 at 1:40

GoogleCodeExporter commented 8 years ago
Hi again. If the change is finally discarded (because is not a good standard or
something else) there is another CSS pure solution (but a bit hack) to make the 
empty
cells have border. The CSS would look like this:

.jmesa .table {
    empty-cells: show;  /* For Firefox, standard CSS 2.1 */
}
/* For IE6 */
* html .jmesa .table{
    border-collapse: collapse;
}
/* For IE7*/
*:first-child+html .jmesa .table
{
    border-collapse: collapse;
}

Hope this helps somebody.

Original comment by AlejaV...@gmail.com on 14 May 2009 at 8:43

GoogleCodeExporter commented 8 years ago
Have it implemented on the trunk.

Original comment by jeff.johnston.mn@gmail.com on 15 May 2009 at 8:22

GoogleCodeExporter commented 8 years ago

Original comment by jeff.johnston.mn@gmail.com on 15 May 2009 at 8:27