Border around each row in flex table???

197 views
Skip to first unread message

maila...@gmail.com

unread,
Aug 14, 2007, 12:56:27 AM8/14/07
to Google Web Toolkit
Hi All

I have a flex table and I want border around each row (not each cell)
of the table. Also I do not want to create another inner table for
each row. I have tried the following but it does not seem to work :-(

resultTable.getRowFormatter().setStyleName(rowNum,
"resultTableBodyRow");

and in my css

.resultTableBodyRow{
border: 1px solid #000000;
}

Any pointers will be very helpful.

Regards,
Abhi

sal...@gmail.com

unread,
Aug 14, 2007, 9:16:29 AM8/14/07
to Google Web Toolkit
Abhi,

I'm not sure what HTML element the getRowFormatter().setStyleName(...)
affects, but you could put a top and bottom border around the row

tr.resultTableBodyRow {border-top: 1px #ccc solid; border-left: 1px
#ccc solid;}

then for the first and last cells in that row, give them a left and
right border respectively.
resultTable.getFlexCellFormatter(rowNum, 0, "firstCell");
resultTable.getFlexCellFormatter(rowNum, lastColumn, "lastCell");

CSS
td.firstCell {border-left:...}
td.lastCell {border-right:...}

I hope this helps you.

-David

On Aug 14, 12:56 am, "mailabhi...@gmail.com" <mailabhi...@gmail.com>
wrote:

Reinier Zwitserloot

unread,
Aug 14, 2007, 10:27:41 AM8/14/07
to Google Web Toolkit
I doubt you can actually do this properly. If it's possible at all (I
worry about certain browsers - so make sure you test thoroughly on all
4), give your TABLE a certain style, let's say "xyzzy", and then stuff
this in your css:

.xyzzy tr { border: 1px sold black; }

(space-separated selectors in CSS means that the second selector must
appear inside the first, so this means: apply this style to ANY 'tr'
tag inside any tag with class "xyzzy").

Otherwise, use fancy styles on each cell (middle cells have border-top
and border-bottom, left cell also has a border-left, etc), BUT that
will only work right in certain circumstances - e.g. only solid
border, and no padding or spacing of any kind in between cells.


On Aug 14, 6:56 am, "mailabhi...@gmail.com" <mailabhi...@gmail.com>
wrote:

Andre Freller

unread,
Aug 14, 2007, 11:09:31 AM8/14/07
to Google-We...@googlegroups.com

Try this:

TABLE {
    border-collapse: collapse;
    border: solid 2px #000;
}
TD {
    border-style: solid none;
    border-width: 2px;
    border-color: #000;
}

Regards,
Freller
Reply all
Reply to author
Forward
0 new messages