![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Why is there no replacement for td align attribute? Why doesn't text-align:right ever seem to work for me? I can't get correct table layout with Css. The left column should have text aligned to the right of the td column. It's aligned to the left. I can get the effect I want by giving every td tag the align="right" attibute, which breaks xhtml compliance. Presumable I could also put some filler tags inside the td element and apply a style to that - it looks even more evil than the first solution but is xhtml compliant. I there there really no simple way to apply a style to the td element itself? Here is the start of my table: table class="myFund w900" colgroup col id="description" / col id="content" / /colgroup thead tr th colspan="2" style="line-height:1px;"></th /tr /thead tbody tr td>Name</td td>blah ... contains 2 asp.net controls ...</td /tr ... /table I have these Css definitions: col#description {width:16%; text-align:right;} col#content {width:82%; text-align:left; height:15px;} When I look at the detail of the html in Firefox it shows these styles are attached to the <td>Name</td> code: /* firefox shows td has: */ td { padding:2px; vertical-align:top; } /* plus: Inherited from body */ body { font-family:Verdana; font-size:0.7em; } The style information from the col must also be applied because the relative column widths are about 16:82 but text-align:right; is doing nothing. I have tried viewing this in Firefox, Chrome, Ie8 and Safari (most recent versions runing on winXP). |
#3
| |||
| |||
|
|
Why is there no replacement for td align attribute? Why doesn't text-align:right ever seem to work for me? I can't get correct table layout with Css. The left column should have text aligned to the right of the td column. It's aligned to the left. I can get the effect I want by giving every td tag the align="right" attibute, which breaks xhtml compliance. |
|
I there there really no simple way to apply a style to the td element itself? |
|
col#description {width:16%; text-align:right;} col#content {width:82%; text-align:left; height:15px;} [...] The style information from the col must also be applied because the relative column widths are about 16:82 but text-align:right; is doing nothing. |
#4
| |||
| |||
|
|
Why is there no replacement for td align attribute? Why doesn't text-align:right ever seem to work for me? |
|
I have these Css definitions: col#description {width:16%; text-align:right;} col#content {width:82%; text-align:left; height:15px;} When I look at the detail of the html in Firefox it shows these styles are attached to the <td>Name</td> code: /* firefox shows td has: */ td { padding:2px; vertical-align:top; } /* plus: Inherited from body */ body { font-family:Verdana; font-size:0.7em; } The style information from the col must also be applied because the relative column widths are about 16:82 but text-align:right; is doing nothing. I have tried viewing this in Firefox, Chrome, Ie8 and Safari (most recent versions runing on winXP). |
#5
| |||
| |||
|
|
Why doesn't text-align:right ever seem to work for me? |
#6
| |||
| |||
|
|
mark4asp escribió: mark4asp wrote: Why doesn't text-align:right ever seem to work for me? I can get the effect I want by applying the style directly to the td element. I won't work via the col element - although, annoyingly, the css attribute width works through either. This seems to be the case for all browsers. Is this in the CSS definition? If so it seems perculiarly warped. Lets add something to html which allows us to apply a style to an entire table column. But lets cripple it so, in practice, it's next to useless. td {width:16%; text-align:right;} /* first column*/ td + td {width:82%; text-align:left; height:15px;} /*second column*/ (requires CSS2) |
#7
| |||
| |||
|
|
Manuel Collado wrote: mark4asp escribió: mark4asp wrote: Why doesn't text-align:right ever seem to work for me? I can get the effect I want by applying the style directly to the td element. I won't work via the col element - although, annoyingly, the css attribute width works through either. This seems to be the case for all browsers. Is this in the CSS definition? If so it seems perculiarly warped. Lets add something to html which allows us to apply a style to an entire table column. But lets cripple it so, in practice, it's next to useless. td {width:16%; text-align:right;} /* first column*/ td + td {width:82%; text-align:left; height:15px;} /*second column*/ (requires CSS2) Thanks to Michael and whoever else replied. I didn't actually know this bit of CSS Perhaps I read about it a few years ago and dismissed it because it was CSS2. The support is wider now, because of older browsers falling on the |
#8
| |||
| |||
|
|
In article <C7WUl.30988$yr3.12243 (AT) nlpi068 (DOT) nbdc.sbc.com>, Jeff <jeff_thies (AT) att (DOT) net> wrote: http://www.quirksmode.org/css/contents.html An interesting table heading on that page "IE8 as IE8"! <g I did not see, on a quick look, whether Ben predictions has been documented on the page yet. The interesting prediction was that IE8 as IE7 would have its own bugs. |
|
the severity of it being an unknown. <g |
#9
| |||
| |||
|
|
body { font-family:Verdana; font-size:0.7em; |
#10
| |||
| |||
|
|
In article Pine.LNX.4.64.0906021043530.26324 (A...ni-hannover.de>, Andreas Prilop <prilop4321 (AT) trashmail (DOT) net> wrote: On Mon, 1 Jun 2009, mark4asp wrote: body { font-family:Verdana; font-size:0.7em; This is stupid - incredibly stupid! I have chosen Verdana as my preferred typeface in my browser and I have chosen a suitable font size so that I can read text conveniently. Now you reduce the font size by 30% so that I have problems reading. Why do you want that readers cannot read your text? Only morons write body { font-size: 0.7em } Being unwise and ignorant, last time I thought about this, does not mean that someone is a moron. But presumably, there are deeper considerations I miss. |
![]() |
| Thread Tools | |
| Display Modes | |
| |