Solved

Gap between the lines in a table - ASP.Net

Posted on 2010-08-25
7
337 Views
Last Modified: 2012-06-27
I have a column in a table, the gap between the first and second lines should be very less.
Find attached the grid and code.

Could someone help me.

Wrap.bmp
code.bmp
0
Comment
Question by:cimscims
  • 4
  • 2
7 Comments
 
LVL 6

Accepted Solution

by:
hehdaddy earned 500 total points
Comment Utility
If you are using a stylesheet try different line-height values on the hyperlink tag. That should allow you to push the lines closer together. An example would be:

.style32
{
    line-height: 10px;
}

etc.

You may have to play with the numbers to get it right.
0
 

Author Comment

by:cimscims
Comment Utility
line-height did not work. Is there any way? I tried giving cellpadding and cellspacing, both provide the spave between two records..but it will not solve my problem.
0
 
LVL 9

Expert Comment

by:abhinayp86
Comment Utility
try border="0" cellpadding="0" cellspacing="0" for the table(not for tr)
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:cimscims
Comment Utility
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.
0
 
LVL 6

Expert Comment

by:hehdaddy
Comment Utility
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="/wEPDwUKLTQxNDA4MzY4MmRkVxiWO84XT7udX5VqjBTRJK12GvcvQL5GbNNBAWuyIJ8=" />
</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>

0
 

Author Comment

by:cimscims
Comment Utility
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>  

0
 

Author Closing Comment

by:cimscims
Comment Utility
Worked. Thanks.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now