Solved

div vertical alignment

Posted on 2004-03-30
3
1,018 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

Independent Software Vendors: 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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
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?
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

726 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