Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

div vertical alignment

Posted on 2004-03-30
3
Medium Priority
?
1,024 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 1000 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

596 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