-
Jun 6th, 2022, 10:12 AM
#1
Cannot align table
Hi. I'm trying to center the table to display in the center of screen, however whatever I tried does not do that (margin,align etc).
Any ideas (I'm including the align so you can see where is the start of the div).
Thanks
Code:
<div id="divextend" style="margin:0px; align="center";" >
<br /><br />
<table>
<tr >
<td >
<asp:Panel ID="Panel2" runat="server" Visible="false">
<div style="margin:0px auto; display:block; width:1500px">
<table style="border:solid;width:45%; border-color:black;">
<tr>
<td colspan="2">
<telerik:RadLabel runat="server" Text="Ημ/νία Έκδοσης:" Width="150"></telerik:RadLabel>
<telerik:RadTextBox runat="server" Text="" ID="fldDatecreated" Enabled="false" BackColor="LightYellow"></telerik:RadTextBox>
</td>
</tr>
<tr>
<td colspan="2">
<telerik:RadLabel runat="server" Text="Ημ/νία Λήξης:" Width="150"></telerik:RadLabel>
<telerik:RadTextBox runat="server" Text="" ID="fldDateexpire" Enabled="false" BackColor="LightYellow"></telerik:RadTextBox>
</td>
</tr>
<tr>
<td colspan="2">
<telerik:RadLabel runat="server" Text="Αρχικό Ποσό:" Width="150"></telerik:RadLabel>
<telerik:RadTextBox runat="server" Text="" ID="fldInitialamount" Enabled="false" BackColor="LightYellow"></telerik:RadTextBox>
</td>
</tr>
<tr>
<td colspan="2">
<telerik:RadLabel runat="server" Text="Υπόλοιπο Ποσό:" Width="150"></telerik:RadLabel>
<telerik:RadTextBox runat="server" Text="" ID="fldRefundamount" Enabled="false" BackColor="LightYellow"></telerik:RadTextBox>
</td>
</tr>
<tr>
<td colspan="2">
<telerik:RadLabel runat="server" Text="Επέκταση-Ημέρες:" Width="150"></telerik:RadLabel>
<telerik:RadComboBox ID="fldDays" runat="server">
<Items>
<telerik:RadComboBoxItem Value="5" Text="5" />
<telerik:RadComboBoxItem Value="15" Text="15" />
<telerik:RadComboBoxItem Value="30" Text="30" />
<telerik:RadComboBoxItem Value="60" Text="60" />
</Items>
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td style="text-align:center;">
<br />
<telerik:RadButton ID="ReturnButton1" Text="Επέκταση Πιστωτικού" OnClientClicked="
OnClientItemClicked" runat="server" Width="158px" Visible="true" OnClick="ReturnButton1_Click">
</telerik:RadButton>
</td>
</tr>
</table>
</div>
</asp:Panel>
</td>
</tr>
</table>
</div>
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Jun 6th, 2022, 11:34 AM
#2
Re: Cannot align table
Drop the align, set margin: atuo;
also, if you plan to use quotes for properties like margin or align, either 1) don't use quotes internally
Code:
style="margin:0px; align=center;" >
or 2) if you insist, use the opposite quoting marks:
Code:
style="margin:0px; align='center';" >
And lastly, the = isn't used in the style tag:
Code:
style="margin:0px; align:center;" >
But it would be used in the TABLE's align property, in that case you would use quote marks.
Code:
style="margin:0px;" align='center';" >
Personally when I need to center an HTML object, I manipulate the margin style property.
Code:
style="margin:auto;" >
-tg
-
Jun 6th, 2022, 11:38 AM
#3
Re: Cannot align table
Closest I can get is do this on the table:
<table style="border:solid;width:45%; border-color:black;margin:0px auto;display:block;">
It aligns somewhat, not completely centered but better than everything I check. The issue here is that ReturnButton1 moves a little to the left (I could "push" it probably)
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|