Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML Table formatting in ASP

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi
i've a problem in formating the data retrieved from DB in HTML throu' asp.i'm displaying the field headings(Column names) along with the data under it in a group by fashion,becoz of this the columns are not aligned leaving one row bigger than the other,the width of the table is 100%,what should i do, to get the rows in line though they belong to diff tables,i'm having something like this below
i want the rows tobe aligned in one straight line

table-1
-----------------------------------
row-1 |row-2 |row-3 |
-----------------------------------

table-2
-----------------------------------
row-1 |row-2 |row-3 |
-----------------------------------
row-1 |row-2 |row-3 |
-----------------------------------

table-3
-----------------------------------
row-1 |row-2 |row-3 |
-----------------------------------

skm0916
 
try specifying the width of the cell to be the same as the largest column header so that it's always consistent. i.e. <td size=&quot;15%&quot;> (obviously, use the appropriate size). you'll have to do that for each of the three tables on cell 1.
hth
mb
 
hi
i couldn't figure it out,so i'm pasting the sample table format on which i'm working,can u please see it and tell where i need to make changes,i did make the change in <TD> tag of fisrt cell by mentioning the size, but i couldn't see the result,please look into it,
thanks
skm0916


<html>
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1252&quot;>
</head>

<Body>

<table width=100% >
<table width=100% border=&quot;1&quot; >
<tr><td>&nbsp;</td></tr><tr><td>
<img src=/images/line1.gif></td></tr><tr><td><b>Job Title:</b>&nbsp;programmer</td></tr>
</table>

<table width=&quot;100%&quot; border=&quot;1&quot;>
<tr>
<td bgColor=#eef0f1 ><b>Course Title</b></td>
<td bgColor=#eef0f1 ><b>Mandatory</b></td>
<td bgColor=#eef0f1 ><b>Required by Company</b></td>
</tr>
<tr>
<td >Microsoft Word Training</td>
<td >False</td>
<td >True</td>
</tr>
<tr>
<td >SQL Server</td>
<td>False</td>
<td>True</td>
</tr>
<tr>
<td >Visual Basic</td>
<td >True</td>
<td >False</td>
</tr>
</table>
<table width=100% border=&quot;1&quot;><tr><td>&nbsp;</td></tr><tr><td>
<img src=/images/line1.gif></td></tr><tr><td><b>Job Title:</b>&nbsp;supervisor</td></tr>
</table>
<table width=100% border=&quot;1&quot; >
<tr>
<td bgColor=#eef0f1 ><b>Course Title</b></td>
<td bgColor=#eef0f1 ><b>Mandatory</b></td>
<td bgColor=#eef0f1 ><b>Required by Company</b></td>
</tr>
<tr><td >Bloodborne Pathogens</td>
<td >False</td>
<td >True</td>
</tr>
<tr>
<td >Confined Space Entry</td>
<td >False</td>
<td >True</td>
</tr>
<tr>
<td >Microsoft Word Training</td>
<td >False</td>
<td >True</td>
</tr>
<tr>
<td >Personal Protective Equipment</td>
<td >False</td>
<td >True</td>
</tr>
<tr>
<td >SQL Server</td>
<td >False</td>
<td >True</td>
</tr>
<tr>
<td >Visual Basic</td>
<td >False</td>
<td >True</td>
</tr>
</table>
<img src=&quot;/images/line1.gif&quot;>
</body>
</html>
 
... UI issues - aren't they fun!

The simplest way to do this is to change the way you are building the table. Instead of creating a new table for each job, create one table for the whole thing, like this:
<table>
...loop code here
</table>

Also, if you are needing to do more with the table bordering, I would consider using stylesheets, they give you a lot more control and less issues with browser compliancy.

Have Fun!
munkyCmunkyDU
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top