Solved

div vertical alignment

Posted on 2004-03-30
3
1,017 Views
Last Modified: 2012-06-27
i have a div tag for showing an image everytime i sort desc/asc:


c# assigment

datagridcol.HeaderText = HeaderText.Trim() + "<div ALIGN=right style=top:0;left:0;position:relative;z-index:1; id=" + DataField + "></div>";

======output
<table class="tab" cellspacing="0" cellpadding="4" SortDirection="DESC" border="0" id="DataGrid1" style="border-width:0px;width:100%;border-collapse:collapse;border:solid 1px;">
      <tr class="Grid">
<td align="Center" valign="Middle"><a href="javascript:__doPostBack('DataGrid1$_ctl2$_ctl0','')">Item Code<div ALIGN=right vertical-align:top id=ItemCode></div>

<SCRIPT LANGUAGE=JavaScript1.2>{document.getElementById('ItemCode').innerHTML = '<img src=images/desc_arrow.gif border=0>'}</SCRIPT>

how can i center the image on the div tag?

thanks.
0
Comment
Question by:alain123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 250 total points
ID: 10719412
Like this:

<script type"text/javascript">
H=document.getElementById('ItemCode').offsetHeight/2;
str='<span style="position:absolute;top='+H+'px;">';
str+='<img src="images/desc_arrow.gif" border="0"></span>';
document.getElementById('ItemCode').innerHTML =str;
</script>

Cd&
0
 
LVL 1

Author Comment

by:alain123
ID: 10719555
Thank you!
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 10719682
Glad I could help. Thanks for the A. :^)

Cd&
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

730 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