[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to center align the Div or Table in .net

Posted on 2010-01-05
9
Medium Priority
?
592 Views
Last Modified: 2012-08-14
M trying to align = "Center", but it says its outdated method, Can u suggest me a solution to this
0
Comment
Question by:HelpSunny
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 8

Accepted Solution

by:
Jon500 earned 168 total points
ID: 26187640
There is:
text-align:center;

Also:
margin: 0 auto;

The first is good for text while the second is good for a nested DIV that it inside another "parent" DIV.

Regards,
Jon500
0
 
LVL 8

Expert Comment

by:Jon500
ID: 26187654
In case it wasn't clear:

<DIV style="width:100%;text-align:center">Hi there.</DIV>

Cheers,
Jon500
0
 
LVL 6

Assisted Solution

by:hehdaddy
hehdaddy earned 84 total points
ID: 26187695
<div style="margin-left:auto; margin-right:auto"></div>

That should center it for you.
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
LVL 4

Assisted Solution

by:apexpert
apexpert earned 164 total points
ID: 26187698
use  style="
width:100%;
 text-align:center;
margin-left=--px;
margin-right=--px;
 "
any
if its not work then use one parent table wiht width=100%,  align=center,  border=0
0
 

Author Comment

by:HelpSunny
ID: 26187799
Can a table be created inside a row or a column? M trying to that but its not accepting.
0
 
LVL 8

Assisted Solution

by:Jon500
Jon500 earned 168 total points
ID: 26187849
*** Can a table be created inside a row or a column? M trying to that but its not accepting. ***

This is a separate question entirely, is it not? Please review EE rules.

We tried to help you with your first question... Did we?

Regards,
Jon500
0
 
LVL 15

Assisted Solution

by:rajeeshmca
rajeeshmca earned 84 total points
ID: 26187987
You cannot create a table within a row. U can only create table within a cell like

<table>
  <tr>
     <td>
         <table>
           <tr>
                  <td>
                  </td>
           </tr>
          </table>
     </td>
   </tr>
</table>
0
 
LVL 4

Assisted Solution

by:apexpert
apexpert earned 164 total points
ID: 26188060
U can only create table within a cell mins in <td></td>

<table width=100% border=0>
   <tr>
         <td width=100%>
<!-- Your Design will start from there -->
         </td>
   </tr>
</table>
0
 

Author Closing Comment

by:HelpSunny
ID: 31673338
Thank U
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses
Course of the Month18 days, 22 hours left to enroll

834 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