Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

horizontal align with css?

Original Message
Name: tImmaY
Date: July 7, 2004 at 00:34:37 Pacific
Subject: horizontal align with css?
OS: Windows XP Pro SP1
CPU/Ram: AMD Athlon XP 2400+/512 m
Comment:
hey, i've done kind of a lot with CSS but i've never come across this, so i was wondering if there was a way that you could horizontally align something (like the information within a table data cell) in css? besides like padding-left and padding-right..?

Report Offensive Message For Removal


Response Number 1
Name: jam14online
Date: July 7, 2004 at 07:54:35 Pacific
Subject: horizontal align with css?
Reply: (edit)
For your specific example, you can use the text-align property to center the information in that cell.

The best method I have found is to make an element a percentage width, for example 65%. Then you can use the margin-left property and set it to 17.5%. This is half of what is left (100 - 65 = 35 / 2 = 17.5), i.e. enough to have an equal margin on each side.

I hope this helps,


James



Report Offensive Follow Up For Removal

Response Number 2
Name: andyhargreaves
Date: July 7, 2004 at 11:08:16 Pacific
Subject: horizontal align with css?
Reply: (edit)
Hi

I use text-align: center in CSS and it works very well. Seems simpler to me than using margins.


Report Offensive Follow Up For Removal

Response Number 3
Name: tImmaY
Date: July 13, 2004 at 00:49:14 Pacific
Subject: horizontal align with css?
Reply: (edit)
thanks james, thats a good idea.. i've used something similar to that to align tables right.

thanks andy but that doesn't quite accomplish what i was thinking to do..


Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: horizontal align with css?

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




My PC has been hijacked!

Lexmark 2600 Printer Issues

btk1w1 infected start here post

Unwanted message remians on screen

Slow boot time


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC