문제

I would like to reproduce the following design

+-----------------------------------+---+---+
| some text here                    | A | B |
+-----------------------------------+---+---+
| some multiline text here                  |
+-------------------------------------------+

Where A and B are fixed width columns containing images.

This would be easily accomplished using a <table> element like this

<table>
    <tr>
        <td>some text here</td>
        <td width="20"><img alt="" src="/imageurl" /></td>
        <td width="20"><img alt="" src="/imageurl" /></td>
    </tr>
    <tr><td colspan="3">some multiline text here</td></tr>
</table>

But I am using the Grid helper within the MVCContrib project. Is there a way to obtain a design like this one for every item inside a list of items?

도움이 되었습니까?

해결책

You can implement your own GridRenderer. From Jeremy Skinner's blog:

The default GridRenderer is the HtmlTableGridRenderer. Which, surprisingly enough, renders the grid as an HTML table. By specifying your own GridRenderer, you can completely alter how the grid is rendered without resorting to completely rewriting the grid component.

You can get some ideas from HtmlTableGridRenderer's source code.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top