cimscims
asked on
Gap between the lines in a table - ASP.Net
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try border="0" cellpadding="0" cellspacing="0" for the table(not for tr)
ASKER
This will not work. The wrapped lines and rows will look similar. I just need to reduce the gap between the wrapped lines(in a single TD) and keep some space between the rows using cellspacing and cellpadding.
Here is some sample markup that comes from an ASP.NET page I made with a fixed width table and an ASP.NET HyperLink control.
I applied a line-height to the "a" tag and it worked. You can squish/expand it as much as you want.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
</title>
<style type="text/css">
a
{
line-height: 13px;
}
</style>
</head>
<body>
<form method="post" action="lt01.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTQxNDA4MzY 4MmRkVxiWO 84XT7udX5V qjBTRJK12G vcvQL5GbNN BAWuyIJ8=" />
</div>
<div>
<table cellspacing="0" cellpadding="0" border="1" width="200">
<tr>
<td style="width: 100px;">Test
</td>
<td style="width: 100px;">
<a id="hl1" href="http://www.google.com">
This is a lot of text that should wrap over at least two lines of text.
</a>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
I applied a line-height to the "a" tag and it worked. You can squish/expand it as much as you want.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
</title>
<style type="text/css">
a
{
line-height: 13px;
}
</style>
</head>
<body>
<form method="post" action="lt01.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTQxNDA4MzY
</div>
<div>
<table cellspacing="0" cellpadding="0" border="1" width="200">
<tr>
<td style="width: 100px;">Test
</td>
<td style="width: 100px;">
<a id="hl1" href="http://www.google.com">
This is a lot of text that should wrap over at least two lines of text.
</a>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
ASKER
sorry hehdaddy. I didn't see your post unitl i signed into EE..i couldn't try your solution as i got it worked with the below code. But it is your idea of using line-height. Thank you.
What i have done is
<td width="42%">
<table>
<tr>
<td style="line-height:14px">
<asp:hyperlink ........... ></asp:hyperlink>
</td>
</tr>
</table>
</td>
What i have done is
<td width="42%">
<table>
<tr>
<td style="line-height:14px">
<asp:hyperlink ........... ></asp:hyperlink>
</td>
</tr>
</table>
</td>
ASKER
Worked. Thanks.
ASKER