PDA

View Full Version : CSS style:centering object in table


jamie.heaney
February 15th, 2005, 12:29 AM
I'm trying to learn html and css. I'm mostly trying to relearn with css.

The code is something like:

<body>
<table class="head_table">
<tr>
<td class="head_td"><div align: "center">
<object....(flashbutton)
</
</
</

My question is that DW is using the div tag to align my object center in the cell and I can't find the proper way to roll this over to the .css file and make the command external? like I'm supposed to be learning to do.

Anyone know how to do that? Do I assign a class to the object? or is there a text to attach in the head_td class?

anyhelp appreciated. ty.

degsy
February 18th, 2005, 07:51 PM
You can use a margin


<style type="text/css">
<!--
.center {
width: auto;
margin-right: 33%;
margin-left: 33%;
border: 1px solid #FF0000;
}
-->
</style>
</head>
<body>
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<th scope="col">&nbsp;</th>
</tr>
<tr>
<td><div class="center">Content for class "center" Goes Here</div></td>
</tr>
</table>

degsy
February 18th, 2005, 08:01 PM
and you can text-align center


<style type="text/css">
<!--
.center {
border: 1px solid #FF0000;
text-align: center;
}
-->
</style>
</head>
<body>
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<th scope="col">&nbsp;</th>
</tr>
<tr>
<td><div class="center"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="button1.swf" />
<param name="quality" value="high" />
<embed src="button1.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
</object></div></td>
</tr>
</table>

jamie.heaney
February 19th, 2005, 10:13 PM
ty ty, strange but text-align seems to work best. overlooked it at first as it seemed text related.

ty again degsy