|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
center align table on page with CSS
how do i center align table on page with CSS?
|
|
#2
|
||||
|
||||
|
Put the table in a paragraph and apply CSS to this element:
<p style="text-align:center">
__________________
Cheers, Dave |
|
#3
|
||||
|
||||
|
Quote:
wrong, p-tags cannot contain block-level elements, and the correct way to center an element with css is to use : .myTable { margin-left:auto; margin-right:auto; } but ofcourse msie doesn't complay with this, so you have to assign text-align:center in the parent element. ie body { text-align:center; } or place a div-tag around the table, with style="text-align:center" as magma suggested |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > center align table on page with CSS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|