Adding <HR> to server side table - formatting question

D

Dot net work

If I add several rows at run time to a server side ASP.NET table, and
one of these rows contains a <HR> horizontal rule, everything is lined
up okay on the left edge, except the horizontal rule line sticks out a
few pixels too much on this left edge side. This is especially so if
one of the rows below or above the rule line is a dynamically created
button for instance.

Does anyone know how I can just get all the rows neatened up a bit on
the left side of the server table please? (I know I'm being fussy
here, but still, it's interesting to know why this is happening.)

Thanks,
Regards, dnw.
 
J

John Saunders

Dot net work said:
If I add several rows at run time to a server side ASP.NET table, and
one of these rows contains a <HR> horizontal rule, everything is lined
up okay on the left edge, except the horizontal rule line sticks out a
few pixels too much on this left edge side. This is especially so if
one of the rows below or above the rule line is a dynamically created
button for instance.

Does anyone know how I can just get all the rows neatened up a bit on
the left side of the server table please? (I know I'm being fussy
here, but still, it's interesting to know why this is happening.)


Perhaps you could supply is with some generated HTML that reproduces the
problem?

John Saunders
 
R

Rob C

I now know why this happens - the ASP.NET button graphic has a bit
"missing" on the top and left of the button "image". When you click the
button and keep the mouse button held down, you see that missing part
"drawn back in" as a black border. That's why the button does not look
aligned with the <HR> tag - it actually is aligned properly, it's just
that there's a bit missing, waiting to be drawn back in when you click
the button.

To make the button exactly aligned with an <HR> tag, here's the HTML
code that works - notice that you need to have 2 nested tables within a
container table. (I've stopped the HR line going right to the end of
the page with a small space, just to have some formatting at the other
end of the screen.)

<TABLE id="Table1" style="Z-INDEX: 101; POSITION: absolute; TOP: 48px"
cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR>
<TD>
<TABLE id="Table2" cellSpacing="0" cellPadding="0" width="100%"
border="0">
<TR>
<TD width="1"></TD>
<td>
<HR width="100%" SIZE="1">
</td>
<td width="50"></td>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD>
<TABLE id="Table3" cellSpacing="0" cellPadding="0" width="100%"
border="0">
<TR>
<TD>
<asp:Button id="Button1" runat="server"
Text="Button"></asp:Button></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top