data grid in jsp

S

savita

Hi All,

I have to fetch records from database and display on jsp page
in data grid.
Record can be displayed in tabular form in table.
How use datagrid in jsp.I have been searching for long time ,but
couldn't . It will be helpful if some could pass on the code .

Thanks
Regards
savita
 
L

Lew

Andrew said:
Is that a statement or a question?
(Note the inclusion of '?' marks my
words as a question.)

In any case, probably much the same way
you might use a <TABLE> in <HTML>.

I suggest using <table> in <html>.

The other will work but is becoming deprecated.

-- Lew
 
S

savita

Is that a statement or a question?
(Note the inclusion of '?' marks my
words as a question.)

In any case, probably much the same way
you might use a <TABLE> in <HTML>.

Andrew T.



Thanks alot for you suggestion.
Thanks
Regards
Savita
 
V

voorth

I have to fetch records from database and display on jsp page
in data grid.
Record can be displayed in tabular form in table.
How use datagrid in jsp.I have been searching for long time ,but
couldn't . It will be helpful if some could pass on the code .

The trick is using the "c:foreach" tag:
assuming you have a collection named "entries"

<c:if test="${not empty entries}">
<table>
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tbody>
<c:forEach
var="entry"
varStatus="status"
items="${entries}"
<tr>
<td>${entry.column1}</td>
<td>${entry.column1}</td>
</tr>
</c:forEach>
</tbody>
</table>
</c:if>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top